From 4b9522c2ab54b2e93700adcce98761adc145c085 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 1 Oct 2015 11:07:00 +1000 Subject: [PATCH 001/538] tckmap: Add ends_corr contrast Computes the Pearson correlation coefficient between the voxels in which the two streamline endpoints reside. Note that no interpolation is performed; it's just the raw signal in the two endpoint voxels. --- src/dwi/tractography/mapping/mapper.cpp | 5 +++ .../tractography/mapping/mapper_plugins.cpp | 35 +++++++++++++++++++ src/dwi/tractography/mapping/mapper_plugins.h | 19 ++++++---- src/dwi/tractography/mapping/twi_stats.cpp | 2 +- src/dwi/tractography/mapping/twi_stats.h | 2 +- 5 files changed, 54 insertions(+), 9 deletions(-) diff --git a/src/dwi/tractography/mapping/mapper.cpp b/src/dwi/tractography/mapping/mapper.cpp index 4c003d54f7..50bf80f2a8 100644 --- a/src/dwi/tractography/mapping/mapper.cpp +++ b/src/dwi/tractography/mapping/mapper.cpp @@ -149,6 +149,11 @@ void TrackMapperTWI::set_factor (const Streamline<>& tck, SetVoxelExtras& out) c out.factor = 0.0; break; + case ENDS_CORR: + assert (factors.size() == 1); + out.factor = factors.front(); + break; + default: throw Exception ("FIXME: Undefined / unsupported track statistic in TrackMapperTWI::get_factor()"); diff --git a/src/dwi/tractography/mapping/mapper_plugins.cpp b/src/dwi/tractography/mapping/mapper_plugins.cpp index d1be3e03c5..717a17cfd2 100644 --- a/src/dwi/tractography/mapping/mapper_plugins.cpp +++ b/src/dwi/tractography/mapping/mapper_plugins.cpp @@ -23,6 +23,7 @@ #include "dwi/tractography/mapping/mapper_plugins.h" +#include "image/nav.h" namespace MR { namespace DWI { @@ -65,6 +66,40 @@ void TWIScalarImagePlugin::load_factors (const std::vector< Point >& tck, factors.push_back (NAN); } + } else if (statistic == ENDS_CORR) { + + // Pearson correlation coefficient between the two endpoints + factors.assign (1, 0.0f); + input_voxel_type start (voxel), end (voxel); + const Point p_start (get_last_point_in_fov (tck, false)); + if (!p_start) return; + const Point v_start (int(std::round (p_start[0])), int(std::round (p_start[1])), int(std::round (p_start[2]))); + Image::Nav::set_pos (start, v_start); + const Point p_end (get_last_point_in_fov (tck, true)); + if (!p_end) return; + const Point v_end (int(std::round (p_end[0])), int(std::round (p_end[1])), int(std::round (p_end[2]))); + Image::Nav::set_pos (end, v_end); + + double start_sum = 0.0, end_sum = 0.0; + for (start[3] = end[3] = 0; start[3] != start.dim (3); ++start[3], ++end[3]) { + start_sum += start.value(); + end_sum += end .value(); + } + const float start_mean = start_sum / double (start.dim (3)); + const float end_mean = end_sum / double (end .dim (3)); + + double product = 0.0, start_sum_variance = 0.0, end_sum_variance = 0.0; + for (start[3] = end[3] = 0; start[3] != start.dim (3); ++start[3], ++end[3]) { + product += ((start.value() - start_mean) * (end.value() - end_mean)); + start_sum_variance += Math::pow2 (start.value() - start_mean); + end_sum_variance += Math::pow2 (end .value() - end_mean); + } + const float product_expectation = product / double (start.dim(3)); + const float start_stdev = std::sqrt (start_sum_variance / double(start.dim(3) - 1)); + const float end_stdev = std::sqrt (end_sum_variance / double(end .dim(3) - 1)); + + factors[0] = product_expectation / (start_stdev * end_stdev); + } else { // The entire length of the track contributes diff --git a/src/dwi/tractography/mapping/mapper_plugins.h b/src/dwi/tractography/mapping/mapper_plugins.h index 0e888ffe03..08546c7751 100644 --- a/src/dwi/tractography/mapping/mapper_plugins.h +++ b/src/dwi/tractography/mapping/mapper_plugins.h @@ -80,8 +80,6 @@ class TODMappingPlugin class TWIImagePluginBase { - typedef Image::BufferPreload::voxel_type input_voxel_type; - public: TWIImagePluginBase (const std::string& input_image) : data (new Image::BufferPreload (input_image)), @@ -100,11 +98,13 @@ class TWIImagePluginBase protected: + typedef Image::BufferPreload::voxel_type input_voxel_type; + std::shared_ptr< Image::BufferPreload > data; const input_voxel_type voxel; // Each instance of the class has its own interpolator for obtaining values // in a thread-safe fashion - mutable Image::Interp::Linear< input_voxel_type > interp; + mutable Image::Interp::Linear interp; // New helper function; find the last point on the streamline from which valid image information can be read const Point get_last_point_in_fov (const std::vector< Point >&, const bool) const; @@ -122,10 +122,15 @@ class TWIScalarImagePlugin : public TWIImagePluginBase TWIImagePluginBase (input_image), statistic (track_statistic) { - if (!((data->ndim() == 3) || (data->ndim() == 4 && data->dim(3) == 1))) - throw Exception ("Scalar image used for TWI must be a 3D image"); - if (data->ndim() == 4) - interp[3] = 0; + if (track_statistic == ENDS_CORR) { + if (data->ndim() != 4) + throw Exception ("Image provided for ends_corr statistic must be a 4D image"); + } else { + if (!((data->ndim() == 3) || (data->ndim() == 4 && data->dim(3) == 1))) + throw Exception ("Scalar image used for TWI must be a 3D image"); + if (data->ndim() == 4) + interp[3] = 0; + } } TWIScalarImagePlugin (const TWIScalarImagePlugin& that) : diff --git a/src/dwi/tractography/mapping/twi_stats.cpp b/src/dwi/tractography/mapping/twi_stats.cpp index 9d98d50f0e..5252999622 100644 --- a/src/dwi/tractography/mapping/twi_stats.cpp +++ b/src/dwi/tractography/mapping/twi_stats.cpp @@ -33,7 +33,7 @@ namespace Mapping { const char* contrasts[] = { "tdi", "length", "invlength", "scalar_map", "scalar_map_count", "fod_amp", "curvature", 0 }; const char* voxel_statistics[] = { "sum", "min", "mean", "max", 0 }; -const char* track_statistics[] = { "sum", "min", "mean", "max", "median", "mean_nonzero", "gaussian", "ends_min", "ends_mean", "ends_max", "ends_prod", 0 }; +const char* track_statistics[] = { "sum", "min", "mean", "max", "median", "mean_nonzero", "gaussian", "ends_min", "ends_mean", "ends_max", "ends_prod", "ends_corr", 0 }; } diff --git a/src/dwi/tractography/mapping/twi_stats.h b/src/dwi/tractography/mapping/twi_stats.h index a67ce2b4b5..323cb9cbe5 100644 --- a/src/dwi/tractography/mapping/twi_stats.h +++ b/src/dwi/tractography/mapping/twi_stats.h @@ -32,7 +32,7 @@ namespace Mapping { enum contrast_t { TDI, LENGTH, INVLENGTH, SCALAR_MAP, SCALAR_MAP_COUNT, FOD_AMP, CURVATURE }; enum vox_stat_t { V_SUM, V_MIN, V_MEAN, V_MAX }; -enum tck_stat_t { T_SUM, T_MIN, T_MEAN, T_MAX, T_MEDIAN, T_MEAN_NONZERO, GAUSSIAN, ENDS_MIN, ENDS_MEAN, ENDS_MAX, ENDS_PROD }; +enum tck_stat_t { T_SUM, T_MIN, T_MEAN, T_MAX, T_MEDIAN, T_MEAN_NONZERO, GAUSSIAN, ENDS_MIN, ENDS_MEAN, ENDS_MAX, ENDS_PROD, ENDS_CORR }; extern const char* contrasts[]; extern const char* voxel_statistics[]; From 78d897c9622690899b39c499c71ab2d5557e34d0 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 1 Oct 2015 11:15:29 +1000 Subject: [PATCH 002/538] New command: tckdynamicmap --- cmd/tckdynamicmap.cpp | 504 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 504 insertions(+) create mode 100644 cmd/tckdynamicmap.cpp diff --git a/cmd/tckdynamicmap.cpp b/cmd/tckdynamicmap.cpp new file mode 100644 index 0000000000..3f928744c9 --- /dev/null +++ b/cmd/tckdynamicmap.cpp @@ -0,0 +1,504 @@ +/* + Copyright 2011 Brain Research Institute, Melbourne, Australia + + Written by Robert E. Smith, 2013. + + This file is part of MRtrix. + + MRtrix is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + MRtrix is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with MRtrix. If not, see . + +*/ + +#include + +#include "command.h" +#include "exception.h" +#include "point.h" +#include "progressbar.h" +#include "thread.h" +#include "thread_queue.h" + +#include "image/buffer.h" +#include "image/buffer_preload.h" +#include "image/header.h" +#include "image/loop.h" +#include "image/transform.h" +#include "image/voxel.h" +#include "math/matrix.h" + +#include "dwi/tractography/file.h" +#include "dwi/tractography/properties.h" + +#include "dwi/tractography/mapping/loader.h" +#include "dwi/tractography/mapping/mapper.h" +#include "dwi/tractography/mapping/mapping.h" +#include "dwi/tractography/mapping/voxel.h" +#include "dwi/tractography/mapping/writer.h" + + + +#define MAX_TRACKS_READ_FOR_HEADER 1000000 +#define MAX_VOXEL_STEP_RATIO 0.333 + + + + +using namespace MR; +using namespace App; + +using namespace MR::DWI; +using namespace MR::DWI::Tractography; +using namespace MR::DWI::Tractography::Mapping; + + + +#define DEFAULT_SLIDING_WINDOW_WIDTH 15 +const char* windows[] = { "rectangle", "triangle", "cosine", "hann", "hamming", "lanczos", NULL }; + + +void usage () { + +AUTHOR = "Robert E. Smith (r.smith@brain.org.au)"; + +DESCRIPTION + + "Generate a sliding-window TWI where the contribution from each streamline is the Pearson correlation between its endpoints in an fMRI time series within that sliding window"; + +ARGUMENTS + + Argument ("tracks", "the input track file.").type_file_in() + + Argument ("fmri", "the fMRI time series").type_image_in() + + Argument ("output", "the output sliding-window TWI image").type_image_out(); + +OPTIONS + + Option ("template", + "an image file to be used as a template for the output (the output image " + "will have the same transform and field of view).") + + Argument ("image").type_image_in() + + + Option ("vox", + "provide either an isotropic voxel size (in mm), or comma-separated list " + "of 3 voxel dimensions.") + + Argument ("size").type_sequence_float() + + + Option ("stat_vox", + "define the statistic for choosing the final voxel intensities for a given contrast " + "type given the individual values from the tracks passing through each voxel\n" + "Options are: sum, min, mean, max (default: mean)") + + Argument ("type").type_choice (voxel_statistics) + + + Option ("window_shape", "specify the shape of the sliding window weighting function. " + "Options are: rectangle, triangle, cosine, hann, hamming, lanczos (default = rectangle)") + + Argument ("shape").type_choice (windows, 0) + + + Option ("window_width", "set the full width of the sliding window (in volumes, not time) (must be an odd number)") + + Argument ("value").type_integer (3, 15, 1e6-1) + + + Option ("resample", + "resample the tracks at regular intervals using Hermite interpolation\n" + "(If omitted, an appropriate interpolation will be determined automatically)") + + Argument ("factor").type_integer (1, 1, std::numeric_limits::max()); + +} + + + + + + + + +class Mapper : public Mapping::TrackMapperBase +{ + + typedef Image::BufferPreload::voxel_type input_voxel_type; + + public: + Mapper (const Image::Header& header, const size_t upsample_ratio, Image::BufferPreload& input_image, const std::vector& windowing_function, const int timepoint) : + Mapping::TrackMapperBase (header), + in (input_image), + fmri_transform (input_image), + kernel (windowing_function), + kernel_centre (kernel.size() / 2), + sample_centre (timepoint) + { + Mapping::TrackMapperBase::set_upsample_ratio (upsample_ratio); + } + + + private: + const input_voxel_type in; // Copy-construct from this rather than using it directly (one for each streamline endpoint) + const Image::Transform fmri_transform; + const std::vector& kernel; + const int kernel_centre, sample_centre; + + // This is where the windowed Pearson correlation coefficient for the streamline is determined + // By overloading this function, the standard mapping functionalities of TrackMapperBase are utilised; + // it's only the per-factor streamline that changes + bool preprocess (const std::vector< Point >&, Mapping::SetVoxel&); + + const Point get_last_voxel_in_fov (const std::vector< Point >&, const bool); + +}; + + + +bool Mapper::preprocess (const std::vector< Point >& tck, Mapping::SetVoxel& out) +{ + + out.factor = 0.0; + + input_voxel_type start_voxel (in), end_voxel (in); + const Point v_start (get_last_voxel_in_fov (tck, false)); + if (v_start == Point (-1, -1, -1)) + return false; + Image::Nav::set_pos (start_voxel, v_start); + + const Point v_end (get_last_voxel_in_fov (tck, true)); + if (v_end == Point (-1, -1, -1)) + return false; + Image::Nav::set_pos (end_voxel, v_end); + + double start_mean = 0.0, end_mean = 0.0, kernel_sum = 0.0; + for (size_t i = 0; i != kernel.size(); ++i) { + start_voxel[3] = end_voxel[3] = sample_centre - kernel_centre + int(i); + if (start_voxel[3] >= 0 && start_voxel[3] < start_voxel.dim(3)) { + start_mean += kernel[i] * start_voxel.value(); + end_mean += kernel[i] * end_voxel .value(); + kernel_sum += kernel[i]; + } + } + start_mean /= kernel_sum; + end_mean /= kernel_sum; + + double corr = 0.0, start_variance = 0.0, end_variance = 0.0; + for (size_t i = 0; i != kernel.size(); ++i) { + start_voxel[3] = end_voxel[3] = sample_centre - kernel_centre + int(i); + if (start_voxel[3] >= 0 && start_voxel[3] < start_voxel.dim(3)) { + corr += kernel[i] * (start_voxel.value() - start_mean) * (end_voxel.value() - end_mean); + start_variance += kernel[i] * Math::pow2 (start_voxel.value() - start_mean); + end_variance += kernel[i] * Math::pow2 (end_voxel .value() - end_mean ); + } + } + corr /= kernel_sum; + start_variance /= kernel_sum; + end_variance /= kernel_sum; + + out.factor = corr / (std::sqrt (start_variance) * std::sqrt (end_variance)); + return true; + +} + + + +// Slightly different to get_last_point_in_fov() provided in the TrackMapperTWIImage: +// want the last voxel traversed by the streamline before exiting the FoV, rather than the last +// point for which a valid tri-linear interpolation can be performed +const Point Mapper::get_last_voxel_in_fov (const std::vector< Point >& tck, const bool end) +{ + + int index = end ? tck.size() - 1 : 0; + const int step = end ? -1 : 1; + do { + const Point& p = fmri_transform.scanner2voxel (tck[index]); + const Point v (std::round (p[0]), std::round (p[1]), std::round (p[2])); + if (Image::Nav::within_bounds (in, v)) + return v; + index += step; + } while (index >= 0 && index < int(tck.size())); + + return Point (-1, -1, -1); + +} + + + + +// This class is similar to Mapping::MapWriter, but doesn't write to a HDD file on close +class Receiver +{ + + public: + Receiver (const Image::Header& header, const vox_stat_t stat_vox) : + buffer (header), + v_buffer (buffer), + vox_stat (stat_vox) + { + Image::Loop loop; + if (vox_stat == V_MIN) { + for (loop.start (v_buffer); loop.ok(); loop.next (v_buffer)) + v_buffer.value() = std::numeric_limits::max(); + } else if (vox_stat == V_MAX) { + for (loop.start (v_buffer); loop.ok(); loop.next (v_buffer)) + v_buffer.value() = -std::numeric_limits::max(); + } + } + + + bool operator() (const Mapping::SetVoxel&); + void scale_by_count (Image::BufferScratch&); + void write (Image::Buffer::voxel_type&); + + + private: + Image::BufferScratch buffer; + Image::BufferScratch::voxel_type v_buffer; + const vox_stat_t vox_stat; + +}; + + + +bool Receiver::operator() (const Mapping::SetVoxel& in) +{ + const float factor = in.factor; + for (Mapping::SetVoxel::const_iterator i = in.begin(); i != in.end(); ++i) { + Image::Nav::set_pos (v_buffer, *i); + switch (vox_stat) { + case V_SUM: v_buffer.value() += factor; break; + case V_MIN: v_buffer.value() = std::min (float(v_buffer.value()), factor); break; + case V_MAX: v_buffer.value() = std::max (float(v_buffer.value()), factor); break; + case V_MEAN: v_buffer.value() += factor; break; + // Unlike Mapping::MapWriter, don't need to deal with counts here + } + } + return true; +} + +void Receiver::scale_by_count (Image::BufferScratch& counts) +{ + Image::BufferScratch::voxel_type v_counts (counts); + Image::Loop loop; + for (loop.start (v_buffer, v_counts); loop.ok(); loop.next (v_buffer, v_counts)) + v_buffer.value() /= float(v_counts.value()); +} + +void Receiver::write (Image::Buffer::voxel_type& v_out) +{ + Image::LoopInOrder loop (v_out, 0, 3); + for (loop.start (v_buffer, v_out); loop.ok(); loop.next (v_buffer, v_out)) + v_out.value() = v_buffer.value(); +} + + + + + + + +// Separate class for generating TDI i.e. receive SetVoxel & write directly to counts +class Count_receiver +{ + + public: + Count_receiver (Image::BufferScratch& out) : + v (out) { } + + bool operator() (const Mapping::SetVoxel&); + + private: + Image::BufferScratch::voxel_type v; + +}; + + + +bool Count_receiver::operator() (const Mapping::SetVoxel& in) +{ + for (Mapping::SetVoxel::const_iterator i = in.begin(); i != in.end(); ++i) { + Image::Nav::set_pos (v, *i); + //if (Image::Nav::within_bounds (v)) // TrackMapperBase checks this + v.value() = v.value() + 1; + } + return true; +} + + + + + + + +void run () { + + const std::string tck_path = argument[0]; + Tractography::Properties properties; + { + // Just get the properties for now; will re-instantiate the reader multiple times later + // TODO Constructor for properties using the file path? + Tractography::Reader tck_file (tck_path, properties); + } + + Image::Stride::List strides (4, 0); + strides[0] = 2; strides[1] = 3; strides[2] = 4; strides[3] = 1; + Image::BufferPreload in_image (argument[1], strides); + + const size_t num_tracks = properties["count"].empty() ? 0 : to (properties["count"]); + + float step_size = 0.0; + if (properties.find ("output_step_size") != properties.end()) + step_size = to (properties["output_step_size"]); + else + step_size = to (properties["step_size"]); + + std::vector voxel_size; + Options opt = get_options("vox"); + if (opt.size()) + voxel_size = opt[0][0]; + + if (voxel_size.size() == 1) + voxel_size.assign (3, voxel_size.front()); + else if (!voxel_size.empty() && voxel_size.size() != 3) + throw Exception ("voxel size must either be a single isotropic value, or a list of 3 comma-separated voxel dimensions"); + + if (!voxel_size.empty()) + INFO ("creating image with voxel dimensions [ " + str(voxel_size[0]) + " " + str(voxel_size[1]) + " " + str(voxel_size[2]) + " ]"); + + Image::Header header; + header.datatype() = DataType::Float32; + header.datatype().set_byte_order_native(); + opt = get_options ("template"); + if (opt.size()) { + Image::Header template_header (opt[0][0]); + header = template_header; + if (!voxel_size.empty()) + oversample_header (header, voxel_size); + } + else { + if (voxel_size.empty()) + throw Exception ("please specify either a template image or the desired voxel size"); + generate_header (header, argument[0], voxel_size); + } + + header.set_ndim (4); + header.dim(3) = in_image.dim(3); + header.comments().push_back ("Sliding window track-weighted image"); + + for (Tractography::Properties::iterator i = properties.begin(); i != properties.end(); ++i) + header.comments().push_back (i->first + ": " + i->second); + for (std::multimap::const_iterator i = properties.roi.begin(); i != properties.roi.end(); ++i) + header.comments().push_back ("ROI: " + i->first + " " + i->second); + for (std::vector::iterator i = properties.comments.begin(); i != properties.comments.end(); ++i) + header.comments().push_back ("comment: " + *i); + + size_t resample_factor; + opt = get_options ("resample"); + if (opt.size()) { + resample_factor = opt[0][0]; + INFO ("track interpolation factor manually set to " + str(resample_factor)); + } + else if (step_size && finite (step_size)) { + resample_factor = std::ceil (step_size / (minvalue (header.vox(0), header.vox(1), header.vox(2)) * MAX_VOXEL_STEP_RATIO)); + INFO ("track interpolation factor automatically set to " + str(resample_factor)); + } + else { + resample_factor = 1; + WARN ("track interpolation off; track step size information in header is absent or malformed"); + } + + //Math::Matrix interp_matrix (resample_factor > 1 ? gen_interp_matrix (resample_factor) : Math::Matrix ()); + + opt = get_options ("stat_vox"); + vox_stat_t stat_vox = opt.size() ? vox_stat_t(int(opt[0][0])) : V_MEAN; + + // Generate the window filter + opt = get_options ("window_width"); + const int window_width = opt.size() ? to(opt[0][0]) : DEFAULT_SLIDING_WINDOW_WIDTH; + if (!(window_width % 2)) + throw Exception ("Width of sliding time window must be an odd integer"); + opt = get_options ("window_shape"); + const int window_shape = opt.size() ? opt[0][0] : 0; // default = rectangular + + std::vector window (window_width, 0.0); + const int halfwidth = (window_width+1) / 2; + const int centre = (window_width-1) / 2; // Element at centre of the window + + switch (window_shape) { + + case 0: // rectangular + window.assign (window_width, 1.0); + break; + + case 1: // triangle + for (int i = 0; i != window_width; ++i) + window[i] = 1.0 - (std::abs (i - centre) / float(halfwidth)); + break; + + case 2: // cosine + for (int i = 0; i != window_width; ++i) + window[i] = std::sin (i * M_PI / float(window_width - 1)); + break; + + case 3: // hann + for (int i = 0; i != window_width; ++i) + window[i] = 0.5 * (1.0 - std::cos (2.0 * M_PI * i / float(window_width - 1))); + break; + + case 4: // hamming + for (int i = 0; i != window_width; ++i) + window[i] = 0.53836 - (0.46164 * std::cos (2.0 * M_PI * i / float(window_width - 1))); + break; + + case 5: // lanczos + for (int i = 0; i != window_width; ++i) { + const double v = 2.0 * M_PI * std::abs (i - centre) / float(window_width - 1); + window[i] = v ? std::max (0.0, (std::sin (v) / v)) : 1.0; + } + break; + + } + + // TODO Reconsider pre-calculating & storing SetVoxel for each streamline + // - Faster, but ups RAM requirements, may become prohibitive with super-resolution + // TODO Add voxel-wise statistic V_MEAN_ABS - mean absolute value? + + Image::Buffer out_image (argument[2], header); + Image::Header H_3d (header); + H_3d.set_ndim (3); + + std::unique_ptr< Image::BufferScratch > counts; + if (stat_vox == V_MEAN) { + counts.reset (new Image::BufferScratch (H_3d)); + Tractography::Reader tck_file (tck_path, properties); + Mapping::TrackLoader loader (tck_file, num_tracks, "Calculating initial TDI... "); + Mapping::TrackMapperBase mapper (H_3d); + mapper.set_upsample_ratio (resample_factor); + Count_receiver receiver (*counts); + Thread::run_queue (loader, Thread::batch (Tractography::Streamline<>()), Thread::multi (mapper), Thread::batch (Mapping::SetVoxel()), receiver); + } + + + ProgressBar progress ("Generating sliding time-window TWI... ", header.dim(3)); + for (int timepoint = 0; timepoint != header.dim(3); ++timepoint) { + + { + LogLevelLatch latch (0); + Tractography::Reader tck_file (tck_path, properties); + Mapping::TrackLoader loader (tck_file); + Mapper mapper (H_3d, resample_factor, in_image, window, timepoint); + Receiver receiver (H_3d, stat_vox); + Thread::run_queue (loader, Thread::batch (Tractography::Streamline<>()), Thread::multi (mapper), Thread::batch (Mapping::SetVoxel()), receiver); + + if (stat_vox == V_MEAN) + receiver.scale_by_count (*counts); + + Image::Buffer::voxel_type v_out (out_image); + v_out[3] = timepoint; + receiver.write (v_out); + } + + ++progress; + } + +} + + From fc6e5fb9db8ad93271f218e13dca0c71abbcf288 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 1 Oct 2015 11:17:02 +1000 Subject: [PATCH 003/538] Changes omitted from previous commit --- cmd/tckmap.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/tckmap.cpp b/cmd/tckmap.cpp index 994afce35a..94a85e18ea 100644 --- a/cmd/tckmap.cpp +++ b/cmd/tckmap.cpp @@ -122,7 +122,7 @@ const OptionGroup TWIOption = OptionGroup ("Options for the TWI image contrast p "define the statistic for choosing the contribution to be made by each streamline as a " "function of the samples taken along their lengths\n" "Only has an effect for 'scalar_map', 'fod_amp' and 'curvature' contrast types\n" - "Options are: sum, min, mean, max, median, mean_nonzero, gaussian, ends_min, ends_mean, ends_max, ends_prod (default: mean)") + "Options are: sum, min, mean, max, median, mean_nonzero, gaussian, ends_min, ends_mean, ends_max, ends_prod, ends_corr (default: mean)") + Argument ("type").type_choice (track_statistics) + Option ("fwhm_tck", @@ -421,7 +421,7 @@ void run () { break; case FOD_AMP: - if (stat_tck == ENDS_MIN || stat_tck == ENDS_MEAN || stat_tck == ENDS_MAX || stat_tck == ENDS_PROD) + if (stat_tck == ENDS_MIN || stat_tck == ENDS_MEAN || stat_tck == ENDS_MAX || stat_tck == ENDS_PROD || stat_tck == ENDS_CORR) throw Exception ("Can't use endpoint-based track-wise statistics with FOD_AMP contrast"); break; @@ -545,6 +545,7 @@ void run () { case ENDS_MEAN: msg += "endpoints (mean)"; break; case ENDS_MAX: msg += "endpoints (maximum)"; break; case ENDS_PROD: msg += "endpoints (product)"; break; + case ENDS_CORR: msg += "endpoints (correlation)"; break; default: msg += "ERROR"; break; } msg += " per-track statistic"; @@ -573,7 +574,6 @@ void run () { throw Exception ("If using 'fod_amp' contrast, must provide the relevant spherical harmonic image using -image option"); } const std::string assoc_image (opt[0][0]); - const Image::Header H_assoc_image (assoc_image); if (contrast == SCALAR_MAP || contrast == SCALAR_MAP_COUNT) mapper->add_scalar_image (assoc_image); else From 413f7484dc35230d21760268a7724a721c6ce83b Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 6 Oct 2015 13:11:02 +1100 Subject: [PATCH 004/538] tckdynamic map: Fix to work against new libraries Also changed the mean voxel statistic calculation to provide zeroes outside the brain rather than NANs. --- cmd/tckdynamicmap.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/cmd/tckdynamicmap.cpp b/cmd/tckdynamicmap.cpp index 3f928744c9..f5be3a8060 100644 --- a/cmd/tckdynamicmap.cpp +++ b/cmd/tckdynamicmap.cpp @@ -144,15 +144,15 @@ class Mapper : public Mapping::TrackMapperBase // This is where the windowed Pearson correlation coefficient for the streamline is determined // By overloading this function, the standard mapping functionalities of TrackMapperBase are utilised; // it's only the per-factor streamline that changes - bool preprocess (const std::vector< Point >&, Mapping::SetVoxel&); + bool preprocess (const Streamline<>&, SetVoxelExtras&) const override; - const Point get_last_voxel_in_fov (const std::vector< Point >&, const bool); + const Point get_last_voxel_in_fov (const std::vector< Point >&, const bool) const; }; -bool Mapper::preprocess (const std::vector< Point >& tck, Mapping::SetVoxel& out) +bool Mapper::preprocess (const Streamline<>& tck, SetVoxelExtras& out) const { out.factor = 0.0; @@ -193,7 +193,7 @@ bool Mapper::preprocess (const std::vector< Point >& tck, Mapping::SetVox start_variance /= kernel_sum; end_variance /= kernel_sum; - out.factor = corr / (std::sqrt (start_variance) * std::sqrt (end_variance)); + out.factor = corr / std::sqrt (start_variance * end_variance); return true; } @@ -203,7 +203,7 @@ bool Mapper::preprocess (const std::vector< Point >& tck, Mapping::SetVox // Slightly different to get_last_point_in_fov() provided in the TrackMapperTWIImage: // want the last voxel traversed by the streamline before exiting the FoV, rather than the last // point for which a valid tri-linear interpolation can be performed -const Point Mapper::get_last_voxel_in_fov (const std::vector< Point >& tck, const bool end) +const Point Mapper::get_last_voxel_in_fov (const std::vector< Point >& tck, const bool end) const { int index = end ? tck.size() - 1 : 0; @@ -278,8 +278,12 @@ void Receiver::scale_by_count (Image::BufferScratch& counts) { Image::BufferScratch::voxel_type v_counts (counts); Image::Loop loop; - for (loop.start (v_buffer, v_counts); loop.ok(); loop.next (v_buffer, v_counts)) - v_buffer.value() /= float(v_counts.value()); + for (loop.start (v_buffer, v_counts); loop.ok(); loop.next (v_buffer, v_counts)) { + if (v_counts.value()) + v_buffer.value() /= float(v_counts.value()); + else + v_buffer.value() = 0.0f; + } } void Receiver::write (Image::Buffer::voxel_type& v_out) From c38a349b818d635004bd786d4566ef21b88366c9 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 6 Oct 2015 15:27:17 +1100 Subject: [PATCH 005/538] tckmap: Fix bug in ends_corr statistic --- src/dwi/tractography/mapping/mapper_plugins.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/dwi/tractography/mapping/mapper_plugins.cpp b/src/dwi/tractography/mapping/mapper_plugins.cpp index 717a17cfd2..4df90ac8ce 100644 --- a/src/dwi/tractography/mapping/mapper_plugins.cpp +++ b/src/dwi/tractography/mapping/mapper_plugins.cpp @@ -37,11 +37,11 @@ namespace Mapping { const Point TWIImagePluginBase::get_last_point_in_fov (const std::vector< Point >& tck, const bool end) const { - size_t index = end ? tck.size() - 1 : 0; + ssize_t index = end ? tck.size() - 1 : 0; const int step = end ? -1 : 1; while (interp.scanner (tck[index])) { index += step; - if (index == tck.size()) + if (index == -1 || index == ssize_t(tck.size())) return Point(); } return tck[index]; @@ -73,12 +73,10 @@ void TWIScalarImagePlugin::load_factors (const std::vector< Point >& tck, input_voxel_type start (voxel), end (voxel); const Point p_start (get_last_point_in_fov (tck, false)); if (!p_start) return; - const Point v_start (int(std::round (p_start[0])), int(std::round (p_start[1])), int(std::round (p_start[2]))); - Image::Nav::set_pos (start, v_start); + Image::Nav::set_pos (start, interp, 0, 3); const Point p_end (get_last_point_in_fov (tck, true)); if (!p_end) return; - const Point v_end (int(std::round (p_end[0])), int(std::round (p_end[1])), int(std::round (p_end[2]))); - Image::Nav::set_pos (end, v_end); + Image::Nav::set_pos (end, interp, 0, 3); double start_sum = 0.0, end_sum = 0.0; for (start[3] = end[3] = 0; start[3] != start.dim (3); ++start[3], ++end[3]) { From 48491f9b9c427e364d89a578bd213160f4fc81b3 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 6 Oct 2015 15:29:54 +1100 Subject: [PATCH 006/538] tckdynamicmap: Use unbiased weighted variance estimator --- cmd/tckdynamicmap.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/tckdynamicmap.cpp b/cmd/tckdynamicmap.cpp index f5be3a8060..b0c3841ea5 100644 --- a/cmd/tckdynamicmap.cpp +++ b/cmd/tckdynamicmap.cpp @@ -168,18 +168,21 @@ bool Mapper::preprocess (const Streamline<>& tck, SetVoxelExtras& out) const return false; Image::Nav::set_pos (end_voxel, v_end); - double start_mean = 0.0, end_mean = 0.0, kernel_sum = 0.0; + double start_mean = 0.0, end_mean = 0.0, kernel_sum = 0.0, kernel_sq_sum = 0.0; for (size_t i = 0; i != kernel.size(); ++i) { start_voxel[3] = end_voxel[3] = sample_centre - kernel_centre + int(i); if (start_voxel[3] >= 0 && start_voxel[3] < start_voxel.dim(3)) { start_mean += kernel[i] * start_voxel.value(); end_mean += kernel[i] * end_voxel .value(); kernel_sum += kernel[i]; + kernel_sq_sum += Math::pow2 (kernel[i]); } } start_mean /= kernel_sum; end_mean /= kernel_sum; + const double denom = kernel_sum - (kernel_sq_sum / kernel_sum); + double corr = 0.0, start_variance = 0.0, end_variance = 0.0; for (size_t i = 0; i != kernel.size(); ++i) { start_voxel[3] = end_voxel[3] = sample_centre - kernel_centre + int(i); @@ -189,9 +192,9 @@ bool Mapper::preprocess (const Streamline<>& tck, SetVoxelExtras& out) const end_variance += kernel[i] * Math::pow2 (end_voxel .value() - end_mean ); } } - corr /= kernel_sum; - start_variance /= kernel_sum; - end_variance /= kernel_sum; + corr /= denom; + start_variance /= denom; + end_variance /= denom; out.factor = corr / std::sqrt (start_variance * end_variance); return true; From 411b62b1c634b0c12edbd6afb79805e35f1377ad Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 20 Oct 2015 13:38:08 +1100 Subject: [PATCH 007/538] tckmap and tckdynamicmap: -zero_outside_fov option By default, when the TWI track-wise statistic is based on the streamline endpoints, and a streamline endpoint is outside the image FoV, the last point along the streamline that is within the image FoV will be used. This option allows for the TWI factor of such streamlines to instead be set to zero. --- cmd/tckdynamicmap.cpp | 44 ++++++++---- cmd/tckmap.cpp | 29 ++++++-- src/dwi/tractography/mapping/mapper.cpp | 12 +++- src/dwi/tractography/mapping/mapper.h | 1 + .../tractography/mapping/mapper_plugins.cpp | 70 +++++++++++++------ src/dwi/tractography/mapping/mapper_plugins.h | 35 +++++++--- 6 files changed, 140 insertions(+), 51 deletions(-) diff --git a/cmd/tckdynamicmap.cpp b/cmd/tckdynamicmap.cpp index b0c3841ea5..59e0a42cef 100644 --- a/cmd/tckdynamicmap.cpp +++ b/cmd/tckdynamicmap.cpp @@ -103,6 +103,11 @@ OPTIONS + Option ("window_width", "set the full width of the sliding window (in volumes, not time) (must be an odd number)") + Argument ("value").type_integer (3, 15, 1e6-1) + + Option ("zero_outside_fov", + "if a streamline exits the image FoV, by default the time series of that " + "streamline endpoint will be drawn from the last streamline point within the image " + "FoV. Use this option to instead set the TWI factor to zero for such streamlines.") + + Option ("resample", "resample the tracks at regular intervals using Hermite interpolation\n" "(If omitted, an appropriate interpolation will be determined automatically)") @@ -123,13 +128,14 @@ class Mapper : public Mapping::TrackMapperBase typedef Image::BufferPreload::voxel_type input_voxel_type; public: - Mapper (const Image::Header& header, const size_t upsample_ratio, Image::BufferPreload& input_image, const std::vector& windowing_function, const int timepoint) : + Mapper (const Image::Header& header, const size_t upsample_ratio, Image::BufferPreload& input_image, const std::vector& windowing_function, const int timepoint, const bool zero) : Mapping::TrackMapperBase (header), in (input_image), fmri_transform (input_image), kernel (windowing_function), kernel_centre (kernel.size() / 2), - sample_centre (timepoint) + sample_centre (timepoint), + zero_outside_fov (zero) { Mapping::TrackMapperBase::set_upsample_ratio (upsample_ratio); } @@ -140,6 +146,7 @@ class Mapper : public Mapping::TrackMapperBase const Image::Transform fmri_transform; const std::vector& kernel; const int kernel_centre, sample_centre; + const bool zero_outside_fov; // This is where the windowed Pearson correlation coefficient for the streamline is determined // By overloading this function, the standard mapping functionalities of TrackMapperBase are utilised; @@ -160,12 +167,12 @@ bool Mapper::preprocess (const Streamline<>& tck, SetVoxelExtras& out) const input_voxel_type start_voxel (in), end_voxel (in); const Point v_start (get_last_voxel_in_fov (tck, false)); if (v_start == Point (-1, -1, -1)) - return false; + return true; Image::Nav::set_pos (start_voxel, v_start); const Point v_end (get_last_voxel_in_fov (tck, true)); if (v_end == Point (-1, -1, -1)) - return false; + return true; Image::Nav::set_pos (end_voxel, v_end); double start_mean = 0.0, end_mean = 0.0, kernel_sum = 0.0, kernel_sq_sum = 0.0; @@ -208,19 +215,28 @@ bool Mapper::preprocess (const Streamline<>& tck, SetVoxelExtras& out) const // point for which a valid tri-linear interpolation can be performed const Point Mapper::get_last_voxel_in_fov (const std::vector< Point >& tck, const bool end) const { - int index = end ? tck.size() - 1 : 0; - const int step = end ? -1 : 1; - do { - const Point& p = fmri_transform.scanner2voxel (tck[index]); + if (zero_outside_fov) { + + const Point p = fmri_transform.scanner2voxel (tck[index]); const Point v (std::round (p[0]), std::round (p[1]), std::round (p[2])); if (Image::Nav::within_bounds (in, v)) return v; - index += step; - } while (index >= 0 && index < int(tck.size())); + return Point (-1, -1, -1); + + } else { - return Point (-1, -1, -1); + const int step = end ? -1 : 1; + do { + const Point p = fmri_transform.scanner2voxel (tck[index]); + const Point v (std::round (p[0]), std::round (p[1]), std::round (p[2])); + if (Image::Nav::within_bounds (in, v)) + return v; + index += step; + } while (index >= 0 && index < int(tck.size())); + return Point (-1, -1, -1); + } } @@ -412,8 +428,6 @@ void run () { WARN ("track interpolation off; track step size information in header is absent or malformed"); } - //Math::Matrix interp_matrix (resample_factor > 1 ? gen_interp_matrix (resample_factor) : Math::Matrix ()); - opt = get_options ("stat_vox"); vox_stat_t stat_vox = opt.size() ? vox_stat_t(int(opt[0][0])) : V_MEAN; @@ -464,6 +478,8 @@ void run () { } + const bool zero_outside_fov = get_options ("zero_outside_fov").size(); + // TODO Reconsider pre-calculating & storing SetVoxel for each streamline // - Faster, but ups RAM requirements, may become prohibitive with super-resolution // TODO Add voxel-wise statistic V_MEAN_ABS - mean absolute value? @@ -491,7 +507,7 @@ void run () { LogLevelLatch latch (0); Tractography::Reader tck_file (tck_path, properties); Mapping::TrackLoader loader (tck_file); - Mapper mapper (H_3d, resample_factor, in_image, window, timepoint); + Mapper mapper (H_3d, resample_factor, in_image, window, timepoint, zero_outside_fov); Receiver receiver (H_3d, stat_vox); Thread::run_queue (loader, Thread::batch (Tractography::Streamline<>()), Thread::multi (mapper), Thread::batch (Mapping::SetVoxel()), receiver); diff --git a/cmd/tckmap.cpp b/cmd/tckmap.cpp index 94a85e18ea..28d4341891 100644 --- a/cmd/tckmap.cpp +++ b/cmd/tckmap.cpp @@ -133,7 +133,12 @@ const OptionGroup TWIOption = OptionGroup ("Options for the TWI image contrast p + Option ("map_zero", "if a streamline has zero contribution based on the contrast & statistic, typically it is not mapped; " "use this option to still contribute to the map even if this is the case " - "(these non-contributing voxels can then influence the mean value in each voxel of the map)"); + "(these non-contributing voxels can then influence the mean value in each voxel of the map)") + + + Option ("zero_outside_fov", + "when using -stat_tck ends_*, if the streamline exits the image FoV, by default the value " + "for that streamline endpoint will be drawn from the last streamline point within the image " + "FoV. Use this option to instead set the TWI factor to zero for such streamlines."); @@ -337,6 +342,15 @@ void run () { } + bool zero_outside_fov = false; + if (get_options ("zero_outside_fov").size()) { + if (stat_tck == ENDS_CORR || stat_tck == ENDS_MAX || stat_tck == ENDS_MEAN || stat_tck == ENDS_MIN || stat_tck == ENDS_PROD) + zero_outside_fov = true; + else + WARN ("-zero_outside_fov option ignored; only applicable to endpoint-based track statistics"); + } + + // Determine the dimensionality of the output image writer_dim writer_type = GREYSCALE; @@ -421,8 +435,8 @@ void run () { break; case FOD_AMP: - if (stat_tck == ENDS_MIN || stat_tck == ENDS_MEAN || stat_tck == ENDS_MAX || stat_tck == ENDS_PROD || stat_tck == ENDS_CORR) - throw Exception ("Can't use endpoint-based track-wise statistics with FOD_AMP contrast"); + if (stat_tck == ENDS_CORR) + throw Exception ("Can't use endpoint-correlation track-wise statistic with FOD_AMP contrast"); break; case CURVATURE: @@ -436,6 +450,8 @@ void run () { header["twi_contrast"] = contrasts[contrast]; header["twi_vox_stat"] = voxel_statistics[stat_vox]; header["twi_tck_stat"] = track_statistics[stat_tck]; + if (zero_outside_fov) + header["zero_outside_fov"] = "1"; // Figure out how the streamlines will be mapped @@ -574,10 +590,13 @@ void run () { throw Exception ("If using 'fod_amp' contrast, must provide the relevant spherical harmonic image using -image option"); } const std::string assoc_image (opt[0][0]); - if (contrast == SCALAR_MAP || contrast == SCALAR_MAP_COUNT) + if (contrast == SCALAR_MAP || contrast == SCALAR_MAP_COUNT) { mapper->add_scalar_image (assoc_image); - else + if (zero_outside_fov) + mapper->set_zero_outside_fov(); + } else { mapper->add_fod_image (assoc_image); + } header["twi_assoc_image"] = str(opt[0][0]); } diff --git a/src/dwi/tractography/mapping/mapper.cpp b/src/dwi/tractography/mapping/mapper.cpp index 50bf80f2a8..0336887a5c 100644 --- a/src/dwi/tractography/mapping/mapper.cpp +++ b/src/dwi/tractography/mapping/mapper.cpp @@ -185,13 +185,23 @@ void TrackMapperTWI::add_scalar_image (const std::string& path) image_plugin = new TWIScalarImagePlugin (path, track_statistic); } +void TrackMapperTWI::set_zero_outside_fov() +{ + if (!image_plugin) + throw Exception ("Cannot set zero outside FoV if no TWI associated image provided"); + if (typeid(image_plugin) != typeid(TWIScalarImagePlugin)) + throw Exception ("Zeroing outside FoV is only applicable to scalar image TWI plugins"); + TWIScalarImagePlugin* ptr = dynamic_cast(image_plugin); + ptr->set_zero_outside_fov(); +} + void TrackMapperTWI::add_fod_image (const std::string& path) { if (image_plugin) throw Exception ("Cannot add more than one associated image to TWI"); if (contrast != FOD_AMP) throw Exception ("Cannot add an FOD image to TWI unless the FOD_AMP contrast is used"); - image_plugin = new TWIFODImagePlugin (path); + image_plugin = new TWIFODImagePlugin (path, track_statistic); } diff --git a/src/dwi/tractography/mapping/mapper.h b/src/dwi/tractography/mapping/mapper.h index a4a5fd61e5..28dee8a35c 100644 --- a/src/dwi/tractography/mapping/mapper.h +++ b/src/dwi/tractography/mapping/mapper.h @@ -389,6 +389,7 @@ class TrackMapperTWI : public TrackMapperBase void add_scalar_image (const std::string&); + void set_zero_outside_fov(); void add_fod_image (const std::string&); diff --git a/src/dwi/tractography/mapping/mapper_plugins.cpp b/src/dwi/tractography/mapping/mapper_plugins.cpp index 4df90ac8ce..15b864add0 100644 --- a/src/dwi/tractography/mapping/mapper_plugins.cpp +++ b/src/dwi/tractography/mapping/mapper_plugins.cpp @@ -34,16 +34,27 @@ namespace Mapping { - -const Point TWIImagePluginBase::get_last_point_in_fov (const std::vector< Point >& tck, const bool end) const +const ssize_t TWIImagePluginBase::get_last_index_in_fov (const std::vector< Point >& tck, const bool end) const { ssize_t index = end ? tck.size() - 1 : 0; - const int step = end ? -1 : 1; - while (interp.scanner (tck[index])) { - index += step; - if (index == -1 || index == ssize_t(tck.size())) - return Point(); + if (zero_outside_fov) { + if (interp.scanner (tck[index])) + return -1; + } else { + const ssize_t step = end ? -1 : 1; + while (interp.scanner (tck[index])) { + index += step; + if (index == -1 || index == ssize_t(tck.size())) + return -1; + } } + return index; +} +const Point TWIImagePluginBase::get_last_point_in_fov (const std::vector< Point >& tck, const bool end) const +{ + const ssize_t index = get_last_index_in_fov (tck, end); + if (index == -1) + return Point(); return tck[index]; } @@ -63,7 +74,7 @@ void TWIScalarImagePlugin::load_factors (const std::vector< Point >& tck, if (endpoint.valid()) factors.push_back (interp.value()); else - factors.push_back (NAN); + factors.push_back (0.0); } } else if (statistic == ENDS_CORR) { @@ -105,7 +116,7 @@ void TWIScalarImagePlugin::load_factors (const std::vector< Point >& tck, if (!interp.scanner (*i)) factors.push_back (interp.value()); else - factors.push_back (NAN); + factors.push_back (0.0); } } @@ -117,19 +128,38 @@ void TWIScalarImagePlugin::load_factors (const std::vector< Point >& tck, void TWIFODImagePlugin::load_factors (const std::vector< Point >& tck, std::vector& factors) const { - for (size_t i = 0; i != tck.size(); ++i) { - const Point& p = tck[i]; - if (!interp.scanner (p)) { - // Get the FOD at this (interploated) point - for (interp[3] = 0; interp[3] != interp.dim(3); ++interp[3]) - sh_coeffs[interp[3]] = interp.value(); - // Get the FOD amplitude along the streamline tangent - const Point dir = (tck[(i == tck.size()-1) ? i : (i+1)] - tck[i ? (i-1) : 0]).normalise(); - factors.push_back (precomputer->value (sh_coeffs, dir)); - } else { - factors.push_back (NAN); + if (statistic == ENDS_MAX || statistic == ENDS_MEAN || statistic == ENDS_MIN || statistic == ENDS_PROD) { + + for (size_t tck_end_index = 0; tck_end_index != 2; ++tck_end_index) { + const ssize_t index = get_last_index_in_fov (tck, tck_end_index); + if (index == -1) { + factors.push_back (0.0); + } else { + for (interp[3] = 0; interp[3] != interp.dim(3); ++interp[3]) + sh_coeffs[interp[3]] = interp.value(); + const Point dir = (tck[(index == ssize_t(tck.size()-1)) ? index : (index+1)] - tck[index ? (index-1) : 0]).normalise(); + factors.push_back (precomputer->value (sh_coeffs, dir)); + } } + + } else { + + for (size_t i = 0; i != tck.size(); ++i) { + const Point& p = tck[i]; + if (!interp.scanner (p)) { + // Get the FOD at this (interploated) point + for (interp[3] = 0; interp[3] != interp.dim(3); ++interp[3]) + sh_coeffs[interp[3]] = interp.value(); + // Get the FOD amplitude along the streamline tangent + const Point dir = (tck[(i == tck.size()-1) ? i : (i+1)] - tck[i ? (i-1) : 0]).normalise(); + factors.push_back (precomputer->value (sh_coeffs, dir)); + } else { + factors.push_back (0.0); + } + } + } + } diff --git a/src/dwi/tractography/mapping/mapper_plugins.h b/src/dwi/tractography/mapping/mapper_plugins.h index 08546c7751..39963bb389 100644 --- a/src/dwi/tractography/mapping/mapper_plugins.h +++ b/src/dwi/tractography/mapping/mapper_plugins.h @@ -81,32 +81,46 @@ class TWIImagePluginBase { public: - TWIImagePluginBase (const std::string& input_image) : + TWIImagePluginBase (const std::string& input_image, const tck_stat_t track_statistic) : + statistic (track_statistic), data (new Image::BufferPreload (input_image)), voxel (*data), - interp (voxel) { } + interp (voxel), + zero_outside_fov (false) { } TWIImagePluginBase (const TWIImagePluginBase& that) : + statistic (that.statistic), data (that.data), voxel (that.voxel), - interp (voxel) { } + interp (voxel), + zero_outside_fov (that.zero_outside_fov) { } virtual ~TWIImagePluginBase() { } + void set_zero_outside_fov() { zero_outside_fov = true; } + virtual void load_factors (const std::vector< Point >&, std::vector&) const = 0; protected: typedef Image::BufferPreload::voxel_type input_voxel_type; + const tck_stat_t statistic; + std::shared_ptr< Image::BufferPreload > data; const input_voxel_type voxel; // Each instance of the class has its own interpolator for obtaining values // in a thread-safe fashion mutable Image::Interp::Linear interp; + // If the streamline endpoint extends beyond the image FoV, but we want the value + // at the endpoint, should we backtrack to the first streamline point that _is_ + // within the FoV, or should it provide a value of zero? + bool zero_outside_fov; + // New helper function; find the last point on the streamline from which valid image information can be read + const ssize_t get_last_index_in_fov (const std::vector< Point >&, const bool) const; const Point get_last_point_in_fov (const std::vector< Point >&, const bool) const; }; @@ -119,8 +133,7 @@ class TWIScalarImagePlugin : public TWIImagePluginBase { public: TWIScalarImagePlugin (const std::string& input_image, const tck_stat_t track_statistic) : - TWIImagePluginBase (input_image), - statistic (track_statistic) + TWIImagePluginBase (input_image, track_statistic) { if (track_statistic == ENDS_CORR) { if (data->ndim() != 4) @@ -134,8 +147,7 @@ class TWIScalarImagePlugin : public TWIImagePluginBase } TWIScalarImagePlugin (const TWIScalarImagePlugin& that) : - TWIImagePluginBase (that), - statistic (that.statistic) + TWIImagePluginBase (that) { if (data->ndim() == 4) interp[3] = 0; @@ -143,11 +155,10 @@ class TWIScalarImagePlugin : public TWIImagePluginBase ~TWIScalarImagePlugin() { } - void load_factors (const std::vector< Point >&, std::vector&) const; private: - const tck_stat_t statistic; + }; @@ -158,12 +169,14 @@ class TWIScalarImagePlugin : public TWIImagePluginBase class TWIFODImagePlugin : public TWIImagePluginBase { public: - TWIFODImagePlugin (const std::string& input_image) : - TWIImagePluginBase (input_image), + TWIFODImagePlugin (const std::string& input_image, const tck_stat_t track_statistic) : + TWIImagePluginBase (input_image, track_statistic), N (data->dim(3)), sh_coeffs (new float[N]), precomputer (new Math::SH::PrecomputedAL ()) { + if (track_statistic == ENDS_CORR) + throw Exception ("Cannot use ends_corr track statistic with an FOD image"); Math::SH::check (*data); precomputer->init (Math::SH::LforN (N)); } From 4e850b42ae4238ecc7ea9d32ff1beff8ab2c4e4e Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Sat, 19 Mar 2016 14:44:09 +1100 Subject: [PATCH 008/538] tckmap/tckdynamicmap: Backtracking Previously, if a streamline endpoint was outside the fMRI image, by default the first point inside the FoV would be selected. Now, by default a value of 0 will be assigned to the streamline; however, if the -backtrack option is provided, then it's not just the first point inside the FoV, but the first with a valid time-series. In addition, streamlines should no longer get a value of NaN in cases where -backtrack is not provided. --- cmd/tckdynamicmap.cpp | 95 ++++++++++++------- cmd/tckmap.cpp | 24 ++--- src/dwi/tractography/mapping/mapper.cpp | 8 +- src/dwi/tractography/mapping/mapper.h | 2 +- .../tractography/mapping/mapper_plugins.cpp | 93 ++++++++++++++---- src/dwi/tractography/mapping/mapper_plugins.h | 22 +++-- 6 files changed, 165 insertions(+), 79 deletions(-) diff --git a/cmd/tckdynamicmap.cpp b/cmd/tckdynamicmap.cpp index 59e0a42cef..a5ebebb66e 100644 --- a/cmd/tckdynamicmap.cpp +++ b/cmd/tckdynamicmap.cpp @@ -103,10 +103,9 @@ OPTIONS + Option ("window_width", "set the full width of the sliding window (in volumes, not time) (must be an odd number)") + Argument ("value").type_integer (3, 15, 1e6-1) - + Option ("zero_outside_fov", - "if a streamline exits the image FoV, by default the time series of that " - "streamline endpoint will be drawn from the last streamline point within the image " - "FoV. Use this option to instead set the TWI factor to zero for such streamlines.") + + Option ("backtrack", + "if no valid timeseries is found at the streamline endpoint, backtrack along " + "the streamline trajectory until a valid timeseries is found") + Option ("resample", "resample the tracks at regular intervals using Hermite interpolation\n" @@ -128,14 +127,14 @@ class Mapper : public Mapping::TrackMapperBase typedef Image::BufferPreload::voxel_type input_voxel_type; public: - Mapper (const Image::Header& header, const size_t upsample_ratio, Image::BufferPreload& input_image, const std::vector& windowing_function, const int timepoint, const bool zero) : + Mapper (const Image::Header& header, const size_t upsample_ratio, Image::BufferPreload& input_image, const std::vector& windowing_function, const int timepoint, std::unique_ptr>& mask) : Mapping::TrackMapperBase (header), in (input_image), fmri_transform (input_image), kernel (windowing_function), kernel_centre (kernel.size() / 2), sample_centre (timepoint), - zero_outside_fov (zero) + v_mask (mask ? new Image::BufferScratch::voxel_type (*mask) : nullptr) { Mapping::TrackMapperBase::set_upsample_ratio (upsample_ratio); } @@ -146,14 +145,17 @@ class Mapper : public Mapping::TrackMapperBase const Image::Transform fmri_transform; const std::vector& kernel; const int kernel_centre, sample_centre; - const bool zero_outside_fov; + + // Build a binary mask of voxels that contain valid time series + // (only used if backtracking is enabled) + MR::copy_ptr::voxel_type> v_mask; // This is where the windowed Pearson correlation coefficient for the streamline is determined // By overloading this function, the standard mapping functionalities of TrackMapperBase are utilised; // it's only the per-factor streamline that changes bool preprocess (const Streamline<>&, SetVoxelExtras&) const override; - const Point get_last_voxel_in_fov (const std::vector< Point >&, const bool) const; + const Point get_end_voxel (const std::vector< Point >&, const bool) const; }; @@ -165,12 +167,12 @@ bool Mapper::preprocess (const Streamline<>& tck, SetVoxelExtras& out) const out.factor = 0.0; input_voxel_type start_voxel (in), end_voxel (in); - const Point v_start (get_last_voxel_in_fov (tck, false)); + const Point v_start (get_end_voxel (tck, false)); if (v_start == Point (-1, -1, -1)) return true; Image::Nav::set_pos (start_voxel, v_start); - const Point v_end (get_last_voxel_in_fov (tck, true)); + const Point v_end (get_end_voxel (tck, true)); if (v_end == Point (-1, -1, -1)) return true; Image::Nav::set_pos (end_voxel, v_end); @@ -203,40 +205,45 @@ bool Mapper::preprocess (const Streamline<>& tck, SetVoxelExtras& out) const start_variance /= denom; end_variance /= denom; - out.factor = corr / std::sqrt (start_variance * end_variance); + if (start_variance && end_variance) + out.factor = corr / std::sqrt (start_variance * end_variance); return true; } -// Slightly different to get_last_point_in_fov() provided in the TrackMapperTWIImage: -// want the last voxel traversed by the streamline before exiting the FoV, rather than the last -// point for which a valid tri-linear interpolation can be performed -const Point Mapper::get_last_voxel_in_fov (const std::vector< Point >& tck, const bool end) const +// This function selects a voxel position to sample for this streamline endpoint. If backtracking +// is enabled, and the endpoint voxel is either outside the FoV or doesn't contain a valid +// time series, trace back along the length of the streamline until a voxel with a valid +// time series is found. +const Point Mapper::get_end_voxel (const std::vector< Point >& tck, const bool end) const { int index = end ? tck.size() - 1 : 0; - if (zero_outside_fov) { + if (v_mask) { + + // Do backtracking + const int step = end ? -1 : 1; + for (; index >= 0 && index <= int(tck.size() - 1); index += step) { + const Point p = fmri_transform.scanner2voxel (tck[index]); + const Point v (std::round (p[0]), std::round (p[1]), std::round (p[2])); + // Is this point both within the FoV, and contains a valid time series? + if (Image::Nav::within_bounds (in, v) && Image::Nav::get_value_at_pos (*v_mask, v)) + return v; + } - const Point p = fmri_transform.scanner2voxel (tck[index]); - const Point v (std::round (p[0]), std::round (p[1]), std::round (p[2])); - if (Image::Nav::within_bounds (in, v)) - return v; return Point (-1, -1, -1); } else { - const int step = end ? -1 : 1; - do { - const Point p = fmri_transform.scanner2voxel (tck[index]); - const Point v (std::round (p[0]), std::round (p[1]), std::round (p[2])); - if (Image::Nav::within_bounds (in, v)) - return v; - index += step; - } while (index >= 0 && index < int(tck.size())); + const Point p = fmri_transform.scanner2voxel (tck[index]); + const Point v (std::round (p[0]), std::round (p[1]), std::round (p[2])); + if (Image::Nav::within_bounds (in, v)) + return v; return Point (-1, -1, -1); } + } @@ -349,8 +356,6 @@ bool Count_receiver::operator() (const Mapping::SetVoxel& in) - - void run () { const std::string tck_path = argument[0]; @@ -419,7 +424,7 @@ void run () { resample_factor = opt[0][0]; INFO ("track interpolation factor manually set to " + str(resample_factor)); } - else if (step_size && finite (step_size)) { + else if (step_size && std::isfinite (step_size)) { resample_factor = std::ceil (step_size / (minvalue (header.vox(0), header.vox(1), header.vox(2)) * MAX_VOXEL_STEP_RATIO)); INFO ("track interpolation factor automatically set to " + str(resample_factor)); } @@ -478,7 +483,31 @@ void run () { } - const bool zero_outside_fov = get_options ("zero_outside_fov").size(); + // If necessary, generate mask of fMRI voxels with valid timeseries + // (use ptr value as flag for backtracking activation also) + std::unique_ptr> mask; + if (get_options ("backtrack").size()) { + Image::Header H_mask (header); + H_mask.set_ndim (3); + H_mask.datatype() = DataType::Bit; + mask.reset (new Image::BufferScratch (H_mask)); + Image::BufferScratch::voxel_type v_mask (*mask); + Image::BufferPreload::voxel_type v_in (in_image); + + auto f = [] (Image::BufferPreload::voxel_type& in, Image::BufferScratch::voxel_type& mask) { + for (in[3] = 0; in[3] != in.dim(3); ++in[3]) { + if (std::isfinite (in.value()) && in.value()) { + mask.value() = true; + return true; + } + } + mask.value() = false; + return true; + }; + + Image::ThreadedLoop ("pre-calculating mask of valid time-series voxels...", v_mask) + .run (f, v_in, v_mask); + } // TODO Reconsider pre-calculating & storing SetVoxel for each streamline // - Faster, but ups RAM requirements, may become prohibitive with super-resolution @@ -507,7 +536,7 @@ void run () { LogLevelLatch latch (0); Tractography::Reader tck_file (tck_path, properties); Mapping::TrackLoader loader (tck_file); - Mapper mapper (H_3d, resample_factor, in_image, window, timepoint, zero_outside_fov); + Mapper mapper (H_3d, resample_factor, in_image, window, timepoint, mask); Receiver receiver (H_3d, stat_vox); Thread::run_queue (loader, Thread::batch (Tractography::Streamline<>()), Thread::multi (mapper), Thread::batch (Mapping::SetVoxel()), receiver); diff --git a/cmd/tckmap.cpp b/cmd/tckmap.cpp index 28d4341891..63c6c91ecb 100644 --- a/cmd/tckmap.cpp +++ b/cmd/tckmap.cpp @@ -135,10 +135,10 @@ const OptionGroup TWIOption = OptionGroup ("Options for the TWI image contrast p "use this option to still contribute to the map even if this is the case " "(these non-contributing voxels can then influence the mean value in each voxel of the map)") - + Option ("zero_outside_fov", - "when using -stat_tck ends_*, if the streamline exits the image FoV, by default the value " - "for that streamline endpoint will be drawn from the last streamline point within the image " - "FoV. Use this option to instead set the TWI factor to zero for such streamlines."); + + Option ("backtrack", + "when using -stat_tck ends_*, if the streamline endpoint is outside the FoV, backtrack along " + "the streamline trajectory until an appropriate point is found " + "(note: with -stat_tck ends_corr, this will also look for a valid time-series)"); @@ -342,12 +342,12 @@ void run () { } - bool zero_outside_fov = false; - if (get_options ("zero_outside_fov").size()) { + bool backtrack = false; + if (get_options ("backtrack").size()) { if (stat_tck == ENDS_CORR || stat_tck == ENDS_MAX || stat_tck == ENDS_MEAN || stat_tck == ENDS_MIN || stat_tck == ENDS_PROD) - zero_outside_fov = true; + backtrack = true; else - WARN ("-zero_outside_fov option ignored; only applicable to endpoint-based track statistics"); + WARN ("-backtrack option ignored; only applicable to endpoint-based track statistics"); } @@ -450,8 +450,8 @@ void run () { header["twi_contrast"] = contrasts[contrast]; header["twi_vox_stat"] = voxel_statistics[stat_vox]; header["twi_tck_stat"] = track_statistics[stat_tck]; - if (zero_outside_fov) - header["zero_outside_fov"] = "1"; + if (backtrack) + header["twi_backtrack"] = "1"; // Figure out how the streamlines will be mapped @@ -592,8 +592,8 @@ void run () { const std::string assoc_image (opt[0][0]); if (contrast == SCALAR_MAP || contrast == SCALAR_MAP_COUNT) { mapper->add_scalar_image (assoc_image); - if (zero_outside_fov) - mapper->set_zero_outside_fov(); + if (backtrack) + mapper->set_backtrack(); } else { mapper->add_fod_image (assoc_image); } diff --git a/src/dwi/tractography/mapping/mapper.cpp b/src/dwi/tractography/mapping/mapper.cpp index 0336887a5c..6af06e4f3e 100644 --- a/src/dwi/tractography/mapping/mapper.cpp +++ b/src/dwi/tractography/mapping/mapper.cpp @@ -185,14 +185,14 @@ void TrackMapperTWI::add_scalar_image (const std::string& path) image_plugin = new TWIScalarImagePlugin (path, track_statistic); } -void TrackMapperTWI::set_zero_outside_fov() +void TrackMapperTWI::set_backtrack() { if (!image_plugin) - throw Exception ("Cannot set zero outside FoV if no TWI associated image provided"); + throw Exception ("Cannot backtrack if no TWI associated image provided"); if (typeid(image_plugin) != typeid(TWIScalarImagePlugin)) - throw Exception ("Zeroing outside FoV is only applicable to scalar image TWI plugins"); + throw Exception ("Backtracking is only applicable to scalar image TWI plugins"); TWIScalarImagePlugin* ptr = dynamic_cast(image_plugin); - ptr->set_zero_outside_fov(); + ptr->set_backtrack(); } void TrackMapperTWI::add_fod_image (const std::string& path) diff --git a/src/dwi/tractography/mapping/mapper.h b/src/dwi/tractography/mapping/mapper.h index 28dee8a35c..e90e4b56f7 100644 --- a/src/dwi/tractography/mapping/mapper.h +++ b/src/dwi/tractography/mapping/mapper.h @@ -389,7 +389,7 @@ class TrackMapperTWI : public TrackMapperBase void add_scalar_image (const std::string&); - void set_zero_outside_fov(); + void set_backtrack(); void add_fod_image (const std::string&); diff --git a/src/dwi/tractography/mapping/mapper_plugins.cpp b/src/dwi/tractography/mapping/mapper_plugins.cpp index 15b864add0..d130acb7fb 100644 --- a/src/dwi/tractography/mapping/mapper_plugins.cpp +++ b/src/dwi/tractography/mapping/mapper_plugins.cpp @@ -33,26 +33,74 @@ namespace Mapping { +void TWIImagePluginBase::set_backtrack() +{ + backtrack = true; + if (statistic != ENDS_CORR) + return; + Image::Header H (*data); + H.set_ndim (3); + H.datatype() = DataType::Bit; + backtrack_mask.reset (new Image::BufferScratch (H)); + input_voxel_type v_data (voxel); + Image::BufferScratch::voxel_type v_mask (*backtrack_mask); + auto f = [] (Image::BufferPreload::voxel_type& in, Image::BufferScratch::voxel_type& mask) { + for (in[3] = 0; in[3] != in.dim(3); ++in[3]) { + if (std::isfinite (in.value()) && in.value()) { + mask.value() = true; + return true; + } + } + mask.value() = false; + return true; + }; + + Image::ThreadedLoop ("pre-calculating mask of valid time-series voxels...", v_mask) + .run (f, v_data, v_mask); +} + -const ssize_t TWIImagePluginBase::get_last_index_in_fov (const std::vector< Point >& tck, const bool end) const + + +const ssize_t TWIImagePluginBase::get_end_index (const std::vector< Point >& tck, const bool end) const { ssize_t index = end ? tck.size() - 1 : 0; - if (zero_outside_fov) { - if (interp.scanner (tck[index])) - return -1; - } else { + if (backtrack) { + const ssize_t step = end ? -1 : 1; - while (interp.scanner (tck[index])) { - index += step; - if (index == -1 || index == ssize_t(tck.size())) - return -1; + + if (statistic == ENDS_CORR) { + + Image::BufferScratch::voxel_type v_mask (*backtrack_mask); + for (; index >= 0 && index < ssize_t(tck.size()); index += step) { + const Point p = interp.scanner2voxel (tck[index]); + const Point v (std::round (p[0]), std::round (p[1]), std::round (p[2])); + if (Image::Nav::within_bounds (v_mask, v) && Image::Nav::get_value_at_pos (v_mask, v)) { + interp.scanner (tck[index]); // For the calling function to get the position + return index; + } + } + return -1; + + } else { + + while (interp.scanner (tck[index])) { + index += step; + if (index == -1 || index == ssize_t(tck.size())) + return -1; + } + } + + } else { + if (interp.scanner (tck[index])) + return -1; } return index; } -const Point TWIImagePluginBase::get_last_point_in_fov (const std::vector< Point >& tck, const bool end) const +const Point TWIImagePluginBase::get_end_point (const std::vector< Point >& tck, const bool end) const { - const ssize_t index = get_last_index_in_fov (tck, end); + const ssize_t index = get_end_index (tck, end); if (index == -1) return Point(); return tck[index]; @@ -70,7 +118,7 @@ void TWIScalarImagePlugin::load_factors (const std::vector< Point >& tck, // Only the track endpoints contribute for (size_t tck_end_index = 0; tck_end_index != 2; ++tck_end_index) { - const Point endpoint = get_last_point_in_fov (tck, tck_end_index); + const Point endpoint = get_end_point (tck, tck_end_index); if (endpoint.valid()) factors.push_back (interp.value()); else @@ -82,12 +130,16 @@ void TWIScalarImagePlugin::load_factors (const std::vector< Point >& tck, // Pearson correlation coefficient between the two endpoints factors.assign (1, 0.0f); input_voxel_type start (voxel), end (voxel); - const Point p_start (get_last_point_in_fov (tck, false)); - if (!p_start) return; - Image::Nav::set_pos (start, interp, 0, 3); - const Point p_end (get_last_point_in_fov (tck, true)); - if (!p_end) return; - Image::Nav::set_pos (end, interp, 0, 3); + const ssize_t start_index (get_end_index (tck, false)); + if (start_index < 0) return; + Point p = interp.scanner2voxel (tck[start_index]); + Point v (std::round (p[0]), std::round (p[1]), std::round (p[2])); + Image::Nav::set_pos (start, v, 0, 3); + const ssize_t end_index (get_end_index (tck, true)); + if (end_index < 0) return; + p = interp.scanner2voxel (tck[end_index]); + v.set (std::round (p[0]), std::round (p[1]), std::round (p[2])); + Image::Nav::set_pos (end, v, 0, 3); double start_sum = 0.0, end_sum = 0.0; for (start[3] = end[3] = 0; start[3] != start.dim (3); ++start[3], ++end[3]) { @@ -107,7 +159,8 @@ void TWIScalarImagePlugin::load_factors (const std::vector< Point >& tck, const float start_stdev = std::sqrt (start_sum_variance / double(start.dim(3) - 1)); const float end_stdev = std::sqrt (end_sum_variance / double(end .dim(3) - 1)); - factors[0] = product_expectation / (start_stdev * end_stdev); + if (start_stdev && end_stdev) + factors[0] = product_expectation / (start_stdev * end_stdev); } else { @@ -131,7 +184,7 @@ void TWIFODImagePlugin::load_factors (const std::vector< Point >& tck, st if (statistic == ENDS_MAX || statistic == ENDS_MEAN || statistic == ENDS_MIN || statistic == ENDS_PROD) { for (size_t tck_end_index = 0; tck_end_index != 2; ++tck_end_index) { - const ssize_t index = get_last_index_in_fov (tck, tck_end_index); + const ssize_t index = get_end_index (tck, tck_end_index); if (index == -1) { factors.push_back (0.0); } else { diff --git a/src/dwi/tractography/mapping/mapper_plugins.h b/src/dwi/tractography/mapping/mapper_plugins.h index 39963bb389..d0748db965 100644 --- a/src/dwi/tractography/mapping/mapper_plugins.h +++ b/src/dwi/tractography/mapping/mapper_plugins.h @@ -28,6 +28,7 @@ #include "point.h" #include "image/buffer_preload.h" +#include "image/buffer_scratch.h" #include "image/voxel.h" #include "image/interp/linear.h" #include "math/SH.h" @@ -86,19 +87,20 @@ class TWIImagePluginBase data (new Image::BufferPreload (input_image)), voxel (*data), interp (voxel), - zero_outside_fov (false) { } + backtrack (false) { } TWIImagePluginBase (const TWIImagePluginBase& that) : statistic (that.statistic), data (that.data), voxel (that.voxel), interp (voxel), - zero_outside_fov (that.zero_outside_fov) { } + backtrack (that.backtrack), + backtrack_mask (that.backtrack_mask) { } virtual ~TWIImagePluginBase() { } - void set_zero_outside_fov() { zero_outside_fov = true; } + void set_backtrack(); virtual void load_factors (const std::vector< Point >&, std::vector&) const = 0; @@ -114,14 +116,16 @@ class TWIImagePluginBase // in a thread-safe fashion mutable Image::Interp::Linear interp; - // If the streamline endpoint extends beyond the image FoV, but we want the value - // at the endpoint, should we backtrack to the first streamline point that _is_ - // within the FoV, or should it provide a value of zero? - bool zero_outside_fov; + // If the streamline endpoint doesn't contain a valid value, but we want a valid value + // at all endpoints, should we backtrack to the first streamline point that _does_ have + // a valid value, or should it provide a value of zero? + // If using ENDS_CORR, pre-calculate a mask of voxels that have valid time series + bool backtrack; + std::shared_ptr> backtrack_mask; // New helper function; find the last point on the streamline from which valid image information can be read - const ssize_t get_last_index_in_fov (const std::vector< Point >&, const bool) const; - const Point get_last_point_in_fov (const std::vector< Point >&, const bool) const; + const ssize_t get_end_index (const std::vector< Point >&, const bool) const; + const Point get_end_point (const std::vector< Point >&, const bool) const; }; From d751a5c59ece9f3d2e0f31c2d5b25c2f81268a25 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 21 Mar 2016 13:17:07 +1100 Subject: [PATCH 009/538] tckmap: Fix scalar image check for backtracking --- src/dwi/tractography/mapping/mapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dwi/tractography/mapping/mapper.cpp b/src/dwi/tractography/mapping/mapper.cpp index 6af06e4f3e..2c8dc78b75 100644 --- a/src/dwi/tractography/mapping/mapper.cpp +++ b/src/dwi/tractography/mapping/mapper.cpp @@ -189,7 +189,7 @@ void TrackMapperTWI::set_backtrack() { if (!image_plugin) throw Exception ("Cannot backtrack if no TWI associated image provided"); - if (typeid(image_plugin) != typeid(TWIScalarImagePlugin)) + if (typeid(*image_plugin) != typeid(TWIScalarImagePlugin)) throw Exception ("Backtracking is only applicable to scalar image TWI plugins"); TWIScalarImagePlugin* ptr = dynamic_cast(image_plugin); ptr->set_backtrack(); From 7923b10001b4bba0b68cec5d2fc901a2a6350a33 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 25 Aug 2016 14:16:05 +1000 Subject: [PATCH 010/538] tckmap -stat_tck ends_corr and tckdynamicmap: Use trilinear interpolation --- cmd/tckdynamicmap.cpp | 82 ++++++++++--------- .../tractography/mapping/mapper_plugins.cpp | 60 +++++++------- 2 files changed, 75 insertions(+), 67 deletions(-) diff --git a/cmd/tckdynamicmap.cpp b/cmd/tckdynamicmap.cpp index a5ebebb66e..209645992c 100644 --- a/cmd/tckdynamicmap.cpp +++ b/cmd/tckdynamicmap.cpp @@ -125,11 +125,13 @@ class Mapper : public Mapping::TrackMapperBase { typedef Image::BufferPreload::voxel_type input_voxel_type; + typedef Image::Interp::Linear interp_type; public: Mapper (const Image::Header& header, const size_t upsample_ratio, Image::BufferPreload& input_image, const std::vector& windowing_function, const int timepoint, std::unique_ptr>& mask) : Mapping::TrackMapperBase (header), - in (input_image), + vox (input_image), + interp (vox), fmri_transform (input_image), kernel (windowing_function), kernel_centre (kernel.size() / 2), @@ -141,7 +143,8 @@ class Mapper : public Mapping::TrackMapperBase private: - const input_voxel_type in; // Copy-construct from this rather than using it directly (one for each streamline endpoint) + input_voxel_type vox; + mutable interp_type interp; const Image::Transform fmri_transform; const std::vector& kernel; const int kernel_centre, sample_centre; @@ -155,7 +158,7 @@ class Mapper : public Mapping::TrackMapperBase // it's only the per-factor streamline that changes bool preprocess (const Streamline<>&, SetVoxelExtras&) const override; - const Point get_end_voxel (const std::vector< Point >&, const bool) const; + const Point get_end_point (const std::vector< Point >&, const bool) const; }; @@ -163,42 +166,45 @@ class Mapper : public Mapping::TrackMapperBase bool Mapper::preprocess (const Streamline<>& tck, SetVoxelExtras& out) const { - out.factor = 0.0; - input_voxel_type start_voxel (in), end_voxel (in); - const Point v_start (get_end_voxel (tck, false)); - if (v_start == Point (-1, -1, -1)) - return true; - Image::Nav::set_pos (start_voxel, v_start); - - const Point v_end (get_end_voxel (tck, true)); - if (v_end == Point (-1, -1, -1)) - return true; - Image::Nav::set_pos (end_voxel, v_end); + // Use trilinear interpolation + // Store values into local vectors, since it's a two-pass operation + std::vector values[2]; + for (size_t tck_end_index = 0; tck_end_index != 2; ++tck_end_index) { + const Point endpoint = get_end_point (tck, tck_end_index); + if (!endpoint.valid()) + return true; + values[tck_end_index].reserve (kernel.size()); + for (size_t i = 0; i != kernel.size(); ++i) { + interp[3] = sample_centre - kernel_centre + int(i); + if (interp[3] >= 0 && interp[3] < interp.dim(3)) + values[tck_end_index].push_back (interp.value()); + else + values[tck_end_index].push_back (NAN); + } + } - double start_mean = 0.0, end_mean = 0.0, kernel_sum = 0.0, kernel_sq_sum = 0.0; + // Calculate the Pearson correlation coefficient within the kernel window + double sums[2] = { 0.0, 0.0 }; + double kernel_sum = 0.0, kernel_sq_sum = 0.0; for (size_t i = 0; i != kernel.size(); ++i) { - start_voxel[3] = end_voxel[3] = sample_centre - kernel_centre + int(i); - if (start_voxel[3] >= 0 && start_voxel[3] < start_voxel.dim(3)) { - start_mean += kernel[i] * start_voxel.value(); - end_mean += kernel[i] * end_voxel .value(); + if (std::isfinite (values[0][i])) { + sums[0] += kernel[i] * values[0][i]; + sums[1] += kernel[i] * values[1][i]; kernel_sum += kernel[i]; kernel_sq_sum += Math::pow2 (kernel[i]); } } - start_mean /= kernel_sum; - end_mean /= kernel_sum; - + const double means[2] = { sums[0] / kernel_sum, sums[1] / kernel_sum }; const double denom = kernel_sum - (kernel_sq_sum / kernel_sum); double corr = 0.0, start_variance = 0.0, end_variance = 0.0; for (size_t i = 0; i != kernel.size(); ++i) { - start_voxel[3] = end_voxel[3] = sample_centre - kernel_centre + int(i); - if (start_voxel[3] >= 0 && start_voxel[3] < start_voxel.dim(3)) { - corr += kernel[i] * (start_voxel.value() - start_mean) * (end_voxel.value() - end_mean); - start_variance += kernel[i] * Math::pow2 (start_voxel.value() - start_mean); - end_variance += kernel[i] * Math::pow2 (end_voxel .value() - end_mean ); + if (std::isfinite (values[0][i])) { + corr += kernel[i] * (values[0][i] - means[0]) * (values[1][i] - means[1]); + start_variance += kernel[i] * Math::pow2 (values[0][i] - means[0]); + end_variance += kernel[i] * Math::pow2 (values[1][i] - means[1]); } } corr /= denom; @@ -208,16 +214,19 @@ bool Mapper::preprocess (const Streamline<>& tck, SetVoxelExtras& out) const if (start_variance && end_variance) out.factor = corr / std::sqrt (start_variance * end_variance); return true; - } -// This function selects a voxel position to sample for this streamline endpoint. If backtracking +// This function selects a streamline position to sample for this streamline endpoint. If backtracking // is enabled, and the endpoint voxel is either outside the FoV or doesn't contain a valid // time series, trace back along the length of the streamline until a voxel with a valid // time series is found. -const Point Mapper::get_end_voxel (const std::vector< Point >& tck, const bool end) const +// Note that because trilinear interpolation is used, theoretically a valid time series could be +// obtained for a point within a voxel with no time series; nevertheless, from an implementation +// perspective, it's easier to just require that the voxel in which the sample point resides +// has a valid time series +const Point Mapper::get_end_point (const std::vector< Point >& tck, const bool end) const { int index = end ? tck.size() - 1 : 0; if (v_mask) { @@ -228,19 +237,18 @@ const Point Mapper::get_end_voxel (const std::vector< Point >& tck, const Point p = fmri_transform.scanner2voxel (tck[index]); const Point v (std::round (p[0]), std::round (p[1]), std::round (p[2])); // Is this point both within the FoV, and contains a valid time series? - if (Image::Nav::within_bounds (in, v) && Image::Nav::get_value_at_pos (*v_mask, v)) - return v; + if (Image::Nav::within_bounds (vox, v) && Image::Nav::get_value_at_pos (*v_mask, v)) + return tck[index]; } - - return Point (-1, -1, -1); + return Point(); } else { const Point p = fmri_transform.scanner2voxel (tck[index]); const Point v (std::round (p[0]), std::round (p[1]), std::round (p[2])); - if (Image::Nav::within_bounds (in, v)) - return v; - return Point (-1, -1, -1); + if (Image::Nav::within_bounds (vox, v)) + return tck[index]; + return Point(); } diff --git a/src/dwi/tractography/mapping/mapper_plugins.cpp b/src/dwi/tractography/mapping/mapper_plugins.cpp index d130acb7fb..7402c6985a 100644 --- a/src/dwi/tractography/mapping/mapper_plugins.cpp +++ b/src/dwi/tractography/mapping/mapper_plugins.cpp @@ -127,40 +127,40 @@ void TWIScalarImagePlugin::load_factors (const std::vector< Point >& tck, } else if (statistic == ENDS_CORR) { - // Pearson correlation coefficient between the two endpoints + // Use trilinear interpolation + // Store values into local vectors, since it's a two-pass operation factors.assign (1, 0.0f); - input_voxel_type start (voxel), end (voxel); - const ssize_t start_index (get_end_index (tck, false)); - if (start_index < 0) return; - Point p = interp.scanner2voxel (tck[start_index]); - Point v (std::round (p[0]), std::round (p[1]), std::round (p[2])); - Image::Nav::set_pos (start, v, 0, 3); - const ssize_t end_index (get_end_index (tck, true)); - if (end_index < 0) return; - p = interp.scanner2voxel (tck[end_index]); - v.set (std::round (p[0]), std::round (p[1]), std::round (p[2])); - Image::Nav::set_pos (end, v, 0, 3); - - double start_sum = 0.0, end_sum = 0.0; - for (start[3] = end[3] = 0; start[3] != start.dim (3); ++start[3], ++end[3]) { - start_sum += start.value(); - end_sum += end .value(); + std::vector values[2]; + for (size_t tck_end_index = 0; tck_end_index != 2; ++tck_end_index) { + const Point endpoint = get_end_point (tck, tck_end_index); + if (!endpoint.valid()) + return; + values[tck_end_index].reserve (interp.dim(3)); + for (interp[3] = 0; interp[3] != interp.dim(3); ++interp[3]) + values[tck_end_index].push_back (interp.value()); + } + + // Calculate the Pearson correlation coefficient + double sums[2] = { 0.0, 0.0 }; + for (ssize_t i = 0; i != interp.dim(3); ++i) { + sums[0] += values[0][i]; + sums[1] += values[1][i]; } - const float start_mean = start_sum / double (start.dim (3)); - const float end_mean = end_sum / double (end .dim (3)); - - double product = 0.0, start_sum_variance = 0.0, end_sum_variance = 0.0; - for (start[3] = end[3] = 0; start[3] != start.dim (3); ++start[3], ++end[3]) { - product += ((start.value() - start_mean) * (end.value() - end_mean)); - start_sum_variance += Math::pow2 (start.value() - start_mean); - end_sum_variance += Math::pow2 (end .value() - end_mean); + const double means[2] = { sums[0] / double(interp.dim(3)), sums[1] / double(interp.dim(3)) }; + + double product = 0.0; + double variances[2] = { 0.0, 0.0 }; + for (ssize_t i = 0; i != interp.dim(3); ++i) { + product += ((values[0][i] - means[0]) * (values[1][i] - means[i])); + variances[0] += Math::pow2 (values[0][i] - means[0]); + variances[1] += Math::pow2 (values[1][i] - means[1]); } - const float product_expectation = product / double (start.dim(3)); - const float start_stdev = std::sqrt (start_sum_variance / double(start.dim(3) - 1)); - const float end_stdev = std::sqrt (end_sum_variance / double(end .dim(3) - 1)); + const double product_expectation = product / double (interp.dim(3)); + const double stdevs[2] = { std::sqrt (variances[0] / double(interp.dim(3)-1)), + std::sqrt (variances[1] / double(interp.dim(3)-1)) }; - if (start_stdev && end_stdev) - factors[0] = product_expectation / (start_stdev * end_stdev); + if (stdevs[0] && stdevs[1]) + factors[0] = product_expectation / (stdevs[0] * stdevs[1]); } else { From 30d9bf7f256657b49120f06c1361dc2481f0a96b Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Mon, 8 May 2017 16:41:06 +0100 Subject: [PATCH 011/538] File::MMap: make sure destructor no longer throws As discussed on the forum: http://community.mrtrix.org/t/permission-denied-when-using-mrconvert-and-dwi2response/873 --- core/app.cpp | 1 + core/app.h | 1 + core/command.h | 3 +-- core/file/mmap.cpp | 20 ++++++++++++++------ core/file/mmap.h | 2 +- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/core/app.cpp b/core/app.cpp index 6b46a6a4c7..6f0b2f146b 100644 --- a/core/app.cpp +++ b/core/app.cpp @@ -74,6 +74,7 @@ namespace MR vector argument; vector option; int log_level = 1; + int exit_error_code = 0; bool fail_on_warn = false; bool terminal_use_colour = true; diff --git a/core/app.h b/core/app.h index 175c4c6fdb..ef09cba2ac 100644 --- a/core/app.h +++ b/core/app.h @@ -40,6 +40,7 @@ namespace MR extern const char* mrtrix_version; extern int log_level; + extern int exit_error_code; extern std::string NAME; extern bool overwrite_files; extern void (*check_overwrite_files_func) (const std::string& name); diff --git a/core/command.h b/core/command.h index 7b3e98d47b..d2eef03ccf 100644 --- a/core/command.h +++ b/core/command.h @@ -31,7 +31,6 @@ extern "C" void R_main (int* cmdline_argc, char** cmdline_argv) ::MR::App::project_version = MRTRIX_PROJECT_VERSION; #endif SET_MRTRIX_PROJECT_VERSION - ::MR::App::AUTHOR = "J-Donald Tournier (d.tournier@brain.org.au)"; ::MR::App::DESCRIPTION.clear(); ::MR::App::ARGUMENTS.clear(); ::MR::App::OPTIONS.clear(); @@ -95,7 +94,7 @@ int main (int cmdline_argc, char** cmdline_argv) catch (int retval) { return retval; } - return 0; + return ::MR::App::exit_error_code; } #endif diff --git a/core/file/mmap.cpp b/core/file/mmap.cpp index 8509da6b11..bef419f226 100644 --- a/core/file/mmap.cpp +++ b/core/file/mmap.cpp @@ -29,6 +29,7 @@ #include #endif +#include "app.h" #include "file/ofstream.h" #include "file/path.h" #include "file/mmap.h" @@ -183,7 +184,7 @@ namespace MR - MMap::~MMap() noexcept (false) + MMap::~MMap() { if (!first) return; if (addr) { @@ -199,11 +200,18 @@ namespace MR else { if (readwrite) { INFO ("writing back contents of mapped file \"" + Entry::name + "\"..."); - File::OFStream out (Entry::name, std::ios::in | std::ios::out | std::ios::binary); - out.seekp (start, out.beg); - out.write ((char*) first, msize); - if (!out.good()) - throw Exception ("error writing back contents of file \"" + Entry::name + "\": " + strerror(errno)); + try { + File::OFStream out (Entry::name, std::ios::in | std::ios::out | std::ios::binary); + out.seekp (start, out.beg); + out.write ((char*) first, msize); + if (!out.good()) + throw 1; + } + catch (...) { + FAIL ("error writing back contents of file \"" + Entry::name + "\": " + strerror(errno)); + App::exit_error_code = 1; + } + } delete [] first; } diff --git a/core/file/mmap.h b/core/file/mmap.h index 24e75a3c9a..7570f4dc27 100644 --- a/core/file/mmap.h +++ b/core/file/mmap.h @@ -51,7 +51,7 @@ namespace MR * the byte offset specified in \a entry will be mapped. */ MMap (const Entry& entry, bool readwrite = false, bool preload = true, int64_t mapped_size = -1); - ~MMap () noexcept (false); + ~MMap (); std::string name () const { return Entry::name; From 88ec1c31c31d6113700569bd0150fd4aa94db866 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 13 Jun 2017 09:39:21 +1000 Subject: [PATCH 012/538] tckdynamicmap.cpp: Add necessary MEMALIGN macro --- cmd/tckdynamicmap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/tckdynamicmap.cpp b/cmd/tckdynamicmap.cpp index ff8ee08585..80e01d1e09 100644 --- a/cmd/tckdynamicmap.cpp +++ b/cmd/tckdynamicmap.cpp @@ -109,7 +109,7 @@ OPTIONS // Instead, the one timepoint volume generated during this iteration is written // into the one large buffer that contains the entire TW-dFC time series class Receiver -{ +{ MEMALIGN(Receiver) public: Receiver (const Header& header, const vox_stat_t stat_vox) : @@ -180,7 +180,7 @@ void Receiver::write (Image& out) // Separate class for generating TDI i.e. receive SetVoxel & write directly to counts class Count_receiver -{ +{ MEMALIGN(Count_receiver) public: Count_receiver (Image& out) : v (out) { } From 6e6c15e9a10e20927e2207033c4e7b69eeb7941b Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 28 Jun 2017 14:10:44 +1000 Subject: [PATCH 013/538] Scripts: Changes to image header handling - mrinfo now offers two different command-line options for exporting header information to a JSON file: -json_keyval, which exports only the key/value pairs; and -json_all, which exports all header information. - In the Python script library, a new function image.header() exploits this new feature of mrinfo to import all header information from an image into a class instance. This allows header properties and key/value pairs to be accessed in the same style as what is used in the C++ code. Conversion of data to arrays / matrices and integer / floating-point types is performed implicitly by the JSON import. - In dwi2response, if an algorithm discarded unwanted b-value shells during DWI import, those shells would no longer be available if the user had not provided a brain mask and therefore dwi2mask needed to be run; this change runs dwi2mask on the raw input image instead. - A new function parse_matrix() defined in core/math/math.h standardises the conversion of matrix data stored as a text string (e.g. as is used for the diffusion gradient and phase encoding tables) into Eigen::Matrix data. --- bin/dwi2response | 23 +++--- bin/dwibiascorrect | 20 +++-- bin/dwipreproc | 62 +++++++-------- bin/population_template | 6 +- cmd/mrinfo.cpp | 116 +++++++++++++++++++++++------ core/math/math.h | 18 +++++ core/phase_encoding.cpp | 19 ++--- docs/reference/commands/mrinfo.rst | 7 +- lib/mrtrix3/file.py | 8 +- lib/mrtrix3/image.py | 87 +++++++++++----------- lib/mrtrix3/phaseEncoding.py | 38 +++++----- src/dwi/gradient.cpp | 35 ++++----- 12 files changed, 253 insertions(+), 186 deletions(-) diff --git a/bin/dwi2response b/bin/dwi2response index 5e5a490d58..a75c32ce7a 100755 --- a/bin/dwi2response +++ b/bin/dwi2response @@ -3,7 +3,6 @@ # Script for estimating response functions for spherical deconvolution # A number of different approaches are available within this script for performing response function estimation. - # Make the corresponding MRtrix3 Python libraries available import inspect, os, sys lib_folder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], os.pardir, 'lib'))) @@ -12,7 +11,6 @@ if not os.path.isdir(lib_folder): sys.exit(1) sys.path.insert(0, lib_folder) - from mrtrix3 import algorithm, app, image, path, run @@ -76,7 +74,7 @@ if app.args.grad: grad_import_option = ' -grad ' + path.fromUser(app.args.grad, True) elif app.args.fslgrad: grad_import_option = ' -fslgrad ' + path.fromUser(app.args.fslgrad[0], True) + ' ' + path.fromUser(app.args.fslgrad[1], True) -elif not image.headerField(path.fromUser(app.args.input, False), 'dwgrad'): +elif not 'dw_scheme' in image.header(path.fromUser(app.args.input, False)).keyval: app.error('Script requires diffusion gradient table: either in image header, or using -grad / -fslgrad option') app.makeTempDir() @@ -88,23 +86,20 @@ else: # Don't discard b=0 in multi-shell algorithms run.command('mrconvert ' + path.fromUser(app.args.input, True) + ' ' + path.toTemp('dwi.mif', True) + ' -stride 0,0,0,1' + grad_import_option) if app.args.mask: run.command('mrconvert ' + path.fromUser(app.args.mask, True) + ' ' + path.toTemp('mask.mif', True) + ' -datatype bit') +else: + run.command('dwi2mask ' + path.fromUser(app.args.input, True) + ' ' + path.toTemp('mask.mif', True)) alg.getInputs() app.gotoTempDir() -# Generate a brain mask (if necessary) -# Otherwise, check that the mask provided is appropriate -if os.path.exists('mask.mif'): - dwi_size = [ int(x) for x in image.headerField('dwi.mif', 'size').split() ] - mask_size = [ int(x) for x in image.headerField('mask.mif', 'size').split() ] - if not mask_size[:3] == dwi_size[:3]: - app.error('Dimensions of provided mask image do not match DWI') - if int(image.statistic('mask.mif', 'count', 'mask.mif')) == 0: - app.error('Input mask does not contain any voxels') -else: - run.command('dwi2mask dwi.mif mask.mif') +# Check that the brain mask is appropriate +if not image.header('mask.mif').size[:3] == image.header('dwi.mif').size[:3]: + app.error('Dimensions of provided mask image do not match DWI') +if int(image.statistic('mask.mif', 'count', 'mask.mif')) == 0: + app.error('Input mask does not contain any voxels') + # From here, the script splits depending on what estimation algorithm is being used diff --git a/bin/dwibiascorrect b/bin/dwibiascorrect index 4b701d9713..677e661ef2 100755 --- a/bin/dwibiascorrect +++ b/bin/dwibiascorrect @@ -3,7 +3,6 @@ # Script that performs B1 field inhomogeneity correction for a DWI volume series # Bias field is estimated using the mean b=0 image, and subsequently used to correct all volumes - # Make the corresponding MRtrix3 Python libraries available import inspect, os, sys lib_folder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], os.pardir, 'lib'))) @@ -12,7 +11,6 @@ if not os.path.isdir(lib_folder): sys.exit(1) sys.path.insert(0, lib_folder) - from distutils.spawn import find_executable from mrtrix3 import app, fsl, image, path, run @@ -49,7 +47,7 @@ if app.args.fsl: fast_cmd = 'fsl5.0-fast' if not find_executable(fast_cmd): app.error('Could not find FSL program fast; please verify FSL install') - + fsl_suffix = fsl.suffix() if fast_cmd == 'fast': fast_suffix = fsl_suffix @@ -82,17 +80,17 @@ if app.args.mask: app.gotoTempDir() # Make sure it's actually a DWI that's been passed -dwi_sizes = image.headerField('in.mif', 'size').split() -if len(dwi_sizes) != 4: +dwi_header = image.header('in.mif') +if len(dwi_header.size) != 4: app.error('Input image must be a 4D image') -DW_scheme = image.headerField('in.mif', 'dwgrad').split('\n') -if len(DW_scheme) != int(dwi_sizes[3]): - app.error('Input image does not contain valid DW gradient scheme') +if not 'dw_scheme' in dwi_header.keyval: + app.error('No valid DW gradient scheme provided or present in image header') +if len(dwi_header.keyval['dw_scheme']) != dwi_header.size[3]: + app.error('DW gradient scheme contains different number of entries (' + str(len(dwi_header.keyval['dw_scheme'])) + ' to number of volumes in DWIs (' + dwi_header.size[3] + ')') # Generate a brain mask if required, or check the mask if provided if app.args.mask: - mask_sizes = image.headerField('mask.mif', 'size').split() - if not mask_sizes[:3] == dwi_sizes[:3]: + if not image.header('mask.mif').size[:3] == dwi_header.size[:3]: app.error('Provided mask image does not match input DWI') else: run.command('dwi2mask in.mif mask.mif') @@ -119,7 +117,7 @@ elif app.args.ants: run.command('mrconvert mask.mif mask.nii -stride +1,+2,+3') bias_path = 'bias.nii' run.command('N4BiasFieldCorrection -d 3 -i mean_bzero.nii -w mask.nii -o [corrected.nii,' + bias_path + '] -s 2 -b [150] -c [200x200,0.0]') - + run.command('mrcalc in.mif ' + bias_path + ' -div result.mif') run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + (' -force' if app.force else '')) if app.args.bias: diff --git a/bin/dwipreproc b/bin/dwipreproc index 8802f4d5ae..d5f20c4931 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -14,7 +14,6 @@ # * The (primary) direction of phase encoding. In cases where opposing phase encoding is part of the acquisition protocol (i.e. the reversed phase-encode pair in case 2 above, and all of the DWIs in case 3 above), the -pe_dir option specifies the phase encode direction of the _first_ volume in the relevant volume pair; the second is assumed to be the exact opposite. # * The total readout time of the EPI acquisition. This affects the magnitude of the image distortion for a given field inhomogeneity. If this information is not provided via the -readout_time option, then a 'sane' default of 0.1s will be assumed. Note that this is not actually expected to influence the estimation of the field; it will result in the field inhomogeneity estimation being scaled by some factor, but as long as it uses the same sane default for the DWIs, the distortion correction should operate as expected. - # Make the corresponding MRtrix3 Python libraries available import inspect, os, sys lib_folder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], os.pardir, 'lib'))) @@ -23,7 +22,6 @@ if not os.path.isdir(lib_folder): sys.exit(1) sys.path.insert(0, lib_folder) - import math from distutils.spawn import find_executable from mrtrix3 import app, file, fsl, image, path, phaseEncoding, run @@ -121,8 +119,7 @@ elif app.args.export_grad_fsl: app.checkOutputPath(path.fromUser(app.args.export_grad_fsl[1], False)) -# Convert all input images into MRtrix format and store in temprary directory first; -# that way image.headerField() can be run multiple times without having to repeatedly parse e.g. DICOM data +# Convert all input images into MRtrix format and store in temprary directory first app.makeTempDir() grad_option = '' @@ -136,27 +133,28 @@ if app.args.json_import: run.command('mrconvert ' + path.fromUser(app.args.input, True) + ' ' + path.toTemp('dwi.mif', True) + grad_option + json_option) if app.args.se_epi: image.check3DNonunity(path.fromUser(app.args.se_epi, False)) - run.command('mrconvert ' + path.fromUser(app.args.se_epi, True) + ' ' + path.toTemp('topup_in.mif', True)) + run.command('mrconvert ' + path.fromUser(app.args.se_epi, True) + ' ' + path.toTemp('se_epi.mif', True)) app.gotoTempDir() -# Get information on the input images, particularly so that their validity can be checked -dwi_size = [ int(s) for s in image.headerField('dwi.mif', 'size').split() ] +# Get information on the input images, and check their validity +dwi_header = image.header('dwi.mif') +if not len(dwi_header.size) == 4: + app.error('Input DWI must be a 4D image') +num_volumes = dwi_header.size[3] dwi_pe_scheme = phaseEncoding.getScheme('dwi.mif') if app.args.se_epi: - topup_size = [ int(s) for s in image.headerField('topup_in.mif', 'size').split() ] - if not len(topup_size) == 4: + se_epi_header = image.header('se_epi.mif') + if not len(se_epi_header.size) == 4: app.error('File provided using -se_epi option must contain more than one image volume') - topup_pe_scheme = phaseEncoding.getScheme('topup_in.mif') -grad = image.headerField('dwi.mif', 'dwgrad').split('\n') -grad = [ line.split() for line in grad ] -grad = [ [ float(f) for f in line ] for line in grad ] -stride = image.headerField('dwi.mif', 'stride') -num_volumes = 1 -if len(dwi_size) == 4: - num_volumes = dwi_size[3] + topup_pe_scheme = phaseEncoding.getScheme('se_epi.mif') +if not 'dw_scheme' in dwi_header.keyval: + app.error('No diffusion gradient table found') +grad = dwi_header.keyval['dw_scheme'] +if not len(grad) == num_volumes: + app.error('Number of lines in gradient table (' + str(len(grad)) + ') does not match input image (' + str(num_volumes) + ' volumes); check your input data') @@ -171,17 +169,10 @@ if app.args.readout_time: -# Perform initial checks on input images -if not grad: - app.error('No diffusion gradient table found') -if not len(grad) == num_volumes: - app.error('Number of lines in gradient table (' + str(len(grad)) + ') does not match input image (' + str(num_volumes) + ' volumes); check your input data') - - - do_topup = (not PE_design == 'None') + # Manually generate a phase-encoding table for the input DWI based on user input dwi_manual_pe_scheme = None topup_manual_pe_scheme = None @@ -207,7 +198,7 @@ if manual_pe_dir: line = list(manual_pe_dir) line.append(trt) dwi_manual_pe_scheme = [ line ] * num_volumes - num_topup_volumes = topup_size[3] + num_topup_volumes = se_epi_header.size[3] if num_topup_volumes%2: app.error('If using -rpe_pair option, image provided using -se_epi must contain an even number of volumes') # Assume that first half of volumes have same direction as series; @@ -368,21 +359,20 @@ elif not PE_design == 'None': # No SE EPI images explicitly provided: In some ca # Preferably also make sure that there's some phase-encoding contrast in there... # With -rpe_all, need to write inferred phase-encoding to file and import before using dwiextract so that the phase-encoding # of the extracted b=0's is propagated to the generated b=0 series - run.command('mrconvert dwi.mif' + import_dwi_pe_table_option + ' - | dwiextract - bzeros.mif -bzero') + run.command('mrconvert dwi.mif' + import_dwi_pe_table_option + ' - | dwiextract - se_epi.mif -bzero') + se_epi_header = image.header('se_epi.mif') # If there's no contrast remaining in the phase-encoding scheme, it'll be written to # PhaseEncodingDirection and TotalReadoutTime rather than pe_scheme # In this scenario, we will be unable to run topup, or volume recombination - if not image.headerKeyValue('bzeros.mif', 'pe_scheme'): + if not 'pe_scheme' in se_epi_header.keyval: if PE_design == 'All': app.error('DWI header indicates no phase encoding contrast between b=0 images; cannot proceed with volume recombination-based pre-processing') else: app.warn('DWI header indicates no phase encoding contrast between b=0 images; proceeding without inhomogeneity field estimation') do_topup = False - if do_topup: - run.function(shutil.move, 'bzeros.mif', 'topup_in.mif') - topup_size = [int(s) for s in image.headerField('topup_in.mif', 'size').split()] - file.delTempFile('bzeros.mif') + run.function(os.remove, 'se_epi.mif') + se_epi_header = None # This may be required when setting up the topup call @@ -404,17 +394,17 @@ if do_topup: # If no axes need to be cropped, use the original topup input volumes # Otherwise, need to call mrcrop with the appropriate options, and pass those to topup - topup_in_path = 'topup_in.mif' + topup_in_path = 'se_epi.mif' # For any non-even axis sizes, crop the first voxel along that dimension # TODO This primarily applies to topup - don't recall if eddy bugs out or not crop_option = '' - for axis, axis_size in enumerate(topup_size[:3]): + for axis, axis_size in enumerate(se_epi_header.size[:3]): if int(axis_size)%2: crop_option += ' -axis ' + str(axis) + ' 1 ' + str(int(axis_size)-1) if crop_option: app.warn('Topup images contain at least one non-even dimension; cropping images for topup compatibility') - run.command('mrcrop topup_in.mif topup_in_crop.mif' + crop_option) - file.delTempFile('topup_in.mif') + run.command('mrcrop se_epi.mif topup_in_crop.mif' + crop_option) + file.delTempFile('se_epi.mif') topup_in_path = 'topup_in_crop.mif' # Do the conversion in preparation for topup diff --git a/bin/population_template b/bin/population_template index 82cb2cbd8c..f221a70a2a 100755 --- a/bin/population_template +++ b/bin/population_template @@ -2,7 +2,6 @@ # Generates an unbiased group-average template via image registration of images to a midway space. - # Make the corresponding MRtrix3 Python libraries available import inspect, os, sys lib_folder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], os.pardir, 'lib'))) @@ -12,7 +11,6 @@ if not os.path.isdir(lib_folder): sys.path.insert(0, lib_folder) - import shutil move = shutil.move copy = shutil.copy2 @@ -290,13 +288,13 @@ if app.args.linear_transformations_dir: # automatically detect SH series do_fod_registration = False -image_size = [int(x) for x in image.headerField(relpath(input[0].directory, input[0].filename), 'size').split(' ')] +image_size = image.header(relpath(input[0].directory, input[0].filename)).size if len(image_size) < 3 or len(image_size) > 4: app.error('only 3 and 4 dimensional images can be used to build a template') if len(image_size) == 4: val = (math.sqrt (1 + 8 * image_size[3]) - 3.0) / 4.0; if not (val - int(val)) and not noreorientation: - app.console("SH Series detected, performing FOD registration") + app.console("SH series detected, performing FOD registration") do_fod_registration = True #rigid options diff --git a/cmd/mrinfo.cpp b/cmd/mrinfo.cpp index 23ef14d6eb..2e9176025a 100644 --- a/cmd/mrinfo.cpp +++ b/cmd/mrinfo.cpp @@ -32,6 +32,19 @@ const OptionGroup GradImportOptions = DWI::GradImportOptions(); const OptionGroup GradExportOptions = DWI::GradExportOptions(); +const OptionGroup FieldExportOptions = OptionGroup ("Options for exporting image header fields") + + + Option ("property", "any text properties embedded in the image header under the " + "specified key (use 'all' to list all keys found)").allow_multiple() + + Argument ("key").type_text() + + + Option ("json_keyval", "export header key/value entries to a JSON file") + + Argument ("file").type_file_out() + + + Option ("json_all", "export all header contents to a JSON file") + + Argument ("file").type_file_out(); + + void usage () { @@ -70,12 +83,7 @@ void usage () + NoRealignOption - + Option ("property", "any text properties embedded in the image header under the " - "specified key (use 'all' to list all keys found)").allow_multiple() - + Argument ("key").type_text() - - + Option ("json_export", "export header key/value entries to a JSON file") - + Argument ("file").type_file_out() + + FieldExportOptions + GradImportOptions + Option ("raw_dwgrad", @@ -181,6 +189,64 @@ void print_properties (const Header& header, const std::string& key, const size_ } } +template +void keyval2json (const Header& header, JSON& json) +{ + for (const auto& kv : header.keyval()) { + // Text entries that in fact contain matrix / vector data will be + // converted to numerical matrices / vectors and written as such + try { + const auto M = parse_matrix (kv.second); + for (size_t row = 0; row != M.rows(); ++row) { + std::vector data (M.cols()); + for (size_t i = 0; i != M.cols(); ++i) + data[i] = M (row, i); + if (json.find (kv.first) == json.end()) + json[kv.first] = { data }; + else + json[kv.first].push_back (data); + } + } catch (...) { + if (json.find (kv.first) == json.end()) { + json[kv.first] = kv.second; + } else if (json[kv.first] != kv.second) { + // If the value for this key differs between images, turn the JSON entry into an array + if (json[kv.first].is_array()) + json[kv.first].push_back (kv.second); + else + json[kv.first] = { json[kv.first], kv.second }; + } + } + } +} + +void header2json (const Header& header, nlohmann::json& json) +{ + // Capture _all_ header fields, not just the optional key-value pairs + json["name"] = header.name(); + vector size (header.ndim()), spacing (header.ndim()); + for (size_t axis = 0; axis != header.ndim(); ++axis) { + size[axis] = header.size (axis); + spacing[axis] = header.spacing (axis); + } + json["size"] = size; + json["spacing"] = spacing; + vector strides (Stride::get (header)); + Stride::symbolise (strides); + json["stride"] = strides; + json["format"] = header.format(); + json["datatype"] = header.datatype().specifier(); + json["intensity_offset"] = header.intensity_offset(); + json["intensity_scale"] = header.intensity_scale(); + const transform_type& T (header.transform()); + json["transform"] = { { T(0,0), T(0,1), T(0,2), T(0,3) }, + { T(1,0), T(1,1), T(1,2), T(1,3) }, + { T(2,0), T(2,1), T(2,2), T(2,3) }, + { 0.0, 0.0, 0.0, 1.0 } }; + // Load key-value entries into a nested keyval.* member + keyval2json (header, json["keyval"]); +} + @@ -198,7 +264,8 @@ void run () if (export_pe && argument.size() > 1) throw Exception ("can only export phase encoding table to file if a single input image is provided"); - std::unique_ptr json (get_options ("json_export").size() ? new nlohmann::json : nullptr); + std::unique_ptr json_keyval (get_options ("json_keyval").size() ? new nlohmann::json : nullptr); + std::unique_ptr json_all (get_options ("json_all").size() ? new nlohmann::json : nullptr); if (get_options ("norealign").size()) Header::do_not_realign_transform = true; @@ -220,7 +287,9 @@ void run () const bool petable = get_options("petable") .size(); const bool print_full_header = !(format || ndim || size || vox || datatype || stride || - offset || multiplier || properties.size() || transform || dwgrad || export_grad || shells || shellcounts || export_pe || petable); + offset || multiplier || properties.size() || transform || + dwgrad || export_grad || shells || shellcounts || export_pe || petable || + json_keyval || json_all); Eigen::IOFormat fmt(Eigen::FullPrecision, 0, ", ", "\n", "", "", "", "\n"); @@ -250,29 +319,28 @@ void run () DWI::export_grad_commandline (header); PhaseEncoding::export_commandline (header); - if (json) { - for (const auto& kv : header.keyval()) { - if (json->find (kv.first) == json->end()) { - (*json)[kv.first] = kv.second; - } else if ((*json)[kv.first] != kv.second) { - // If the value for this key differs between images, turn the JSON entry into an array - if ((*json)[kv.first].is_array()) - (*json)[kv.first].push_back (kv.second); - else - (*json)[kv.first] = { (*json)[kv.first], kv.second }; - } - } - } + if (json_keyval) + keyval2json (header, *json_keyval); + + if (json_all) + header2json (header, *json_all); if (print_full_header) std::cout << header.description (get_options ("all").size()); } - if (json) { - auto opt = get_options ("json_export"); + if (json_keyval) { + auto opt = get_options ("json_keyval"); + assert (opt.size()); + File::OFStream out (opt[0][0]); + out << json_keyval->dump(4) << "\n"; + } + + if (json_all) { + auto opt = get_options ("json_all"); assert (opt.size()); File::OFStream out (opt[0][0]); - out << json->dump(4) << "\n"; + out << json_all->dump(4) << "\n"; } } diff --git a/core/math/math.h b/core/math/math.h index 9f402dfa17..7be40b67ba 100644 --- a/core/math/math.h +++ b/core/math/math.h @@ -194,6 +194,24 @@ namespace MR return M; } + //! read matrix data from a text string \a spec + template + Eigen::Matrix parse_matrix (const std::string& spec) + { + Eigen::Matrix M; + const auto lines = split_lines (spec); + for (size_t row = 0; row < lines.size(); ++row) { + const auto values = parse_floats (lines[row]); + if (M.cols() == 0) + M.resize (lines.size(), values.size()); + else if (M.cols() != ssize_t (values.size())) + throw Exception ("error converting string to matrix - uneven number of entries per row"); + for (size_t col = 0; col < values.size(); ++col) + M(row, col) = values[col]; + } + return M; + } + //! read matrix data from \a filename into an Eigen::Tranform class inline transform_type load_transform (const std::string& filename) { diff --git a/core/phase_encoding.cpp b/core/phase_encoding.cpp index 8a0dd7c5b8..de14f6ad5d 100644 --- a/core/phase_encoding.cpp +++ b/core/phase_encoding.cpp @@ -14,6 +14,8 @@ #include "phase_encoding.h" +#include "math/math.h" + namespace MR { namespace PhaseEncoding @@ -86,18 +88,13 @@ namespace MR Eigen::MatrixXd PE; const auto it = header.keyval().find ("pe_scheme"); if (it != header.keyval().end()) { - const auto lines = split_lines (it->second); - if (ssize_t(lines.size()) != ((header.ndim() > 3) ? header.size(3) : 1)) - throw Exception ("malformed PE scheme in image \"" + header.name() + "\" - number of rows does not equal number of volumes"); - for (size_t row = 0; row < lines.size(); ++row) { - const auto values = parse_floats (lines[row]); - if (PE.cols() == 0) - PE.resize (lines.size(), values.size()); - else if (PE.cols() != ssize_t (values.size())) - throw Exception ("malformed PE scheme in image \"" + header.name() + "\" - uneven number of entries per row"); - for (size_t col = 0; col < values.size(); ++col) - PE(row, col) = values[col]; + try { + PE = parse_matrix (it->second); + } catch (Exception& e) { + throw Exception (e, "malformed PE scheme in image \"" + header.name() + "\""); } + if (ssize_t(PE.rows()) != ((header.ndim() > 3) ? header.size(3) : 1)) + throw Exception ("malformed PE scheme in image \"" + header.name() + "\" - number of rows does not equal number of volumes"); } else { // Header entries are cast to lowercase at some point const auto it_dir = header.keyval().find ("PhaseEncodingDirection"); diff --git a/docs/reference/commands/mrinfo.rst b/docs/reference/commands/mrinfo.rst index 8180679d41..9fd762f1b2 100644 --- a/docs/reference/commands/mrinfo.rst +++ b/docs/reference/commands/mrinfo.rst @@ -51,9 +51,14 @@ Options - **-norealign** do not realign transform to near-default RAS coordinate system (the default behaviour on image load). This is useful to inspect the image and/or header contents as they are actually stored in the header, rather than as MRtrix interprets them. +Options for exporting image header fields +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + - **-property key** any text properties embedded in the image header under the specified key (use 'all' to list all keys found) -- **-json_export file** export header key/value entries to a JSON file +- **-json_keyval file** export header key/value entries to a JSON file + +- **-json_all file** export all header contents to a JSON file DW gradient table import options ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/lib/mrtrix3/file.py b/lib/mrtrix3/file.py index 1d1e14a6fb..8b43482e9c 100644 --- a/lib/mrtrix3/file.py +++ b/lib/mrtrix3/file.py @@ -53,14 +53,18 @@ def newTempFile(suffix): from mrtrix3 import app if 'TmpFileDir' in app.config: dir_path = app.config['TmpFileDir'] - else: + elif app._tempDir: dir_path = app._tempDir + else: + dir_path = os.getcwd() if 'TmpFilePrefix' in app.config: prefix = app.config['TmpFilePrefix'] else: prefix = 'mrtrix-tmp-' full_path = dir_path - if not suffix: + if suffix: + suffix = suffix.lstrip('.') + else: suffix = 'mif' while os.path.exists(full_path): random_string = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(6)) diff --git a/lib/mrtrix3/image.py b/lib/mrtrix3/image.py index 4ca0a97ad7..b49eee34bc 100644 --- a/lib/mrtrix3/image.py +++ b/lib/mrtrix3/image.py @@ -13,65 +13,64 @@ def check3DNonunity(image_path): -def headerField(image_path, field): - import subprocess - from mrtrix3 import app, run - command = [ run.exeName(run.versionMatch('mrinfo')), image_path, '-' + field ] - if app._verbosity > 1: - app.console('Command: \'' + ' '.join(command) + '\' (piping data to local storage)') - proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=None) - result, err = proc.communicate() - result = result.rstrip().decode('utf-8') - if app._verbosity > 1: - if '\n' in result: - app.console('Result: (' + str(result.count('\n')+1) + ' lines)') - app.debug(result) - else: - app.console('Result: ' + result) - return result - - +# Function to grab all contents of an image header +# Uses mrinfo's new -json_all option in order to grab all header information +# from any image format supported by MRtrix3's C++ libraries +class _Header: + def __init__(self, image_path): + import json, os, subprocess, tempfile + from mrtrix3 import app, file, run + filename = file.newTempFile('json') + command = [ run.exeName(run.versionMatch('mrinfo')), image_path, '-json_all', filename ] + if app._verbosity > 1: + app.console('Loading header for image file \'' + image_path + '\'') + app.debug(str(command)) + result = subprocess.call(command, stdout=None, stderr=None) + if result: + app.error('Could not access header information for image \'' + image_path + '\'') + with open(filename, 'r') as f: + elements = json.load(f) + os.remove(filename) + self.__dict__.update(elements) + if not self.keyval: + self.keyval = { } -def headerKeyValue(image_path, key): - import subprocess - from mrtrix3 import app, run - command = [ run.exeName(run.versionMatch('mrinfo')), image_path, '-property', key ] - if app._verbosity > 1: - app.console('Command: \'' + ' '.join(command) + '\' (piping data to local storage)') - proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=None) - result, err = proc.communicate() - result = result.rstrip().decode('utf-8') - if app._verbosity > 1: - app.console('Result: ' + result) +def header(image_path): + result = _Header(image_path) return result +# Check to see whether the fundamental header properties of two images match +# Inputs can be either _Header class instances, or file paths def match(image_one, image_two): import math from mrtrix3 import app - debug_prefix = '\'' + image_one + '\' \'' + image_two + '\'' + if not isinstance(image_one, _Header): + if not type(image_one) is str: + app.error('Error trying to test \'' + str(image_one) + '\': Not an image header or file path') + image_one = header(image_one) + if not isinstance(image_two, _Header): + if not type(image_two) is str: + app.error('Error trying to test \'' + str(image_two) + '\': Not an image header or file path') + image_two = header(image_two) + debug_prefix = '\'' + image_one.name + '\' \'' + image_two.name + '\'' # Image dimensions - one_dim = [ int(i) for i in headerField(image_one, 'size').split() ] - two_dim = [ int(i) for i in headerField(image_two, 'size').split() ] - if not one_dim == two_dim: - app.debug(debug_prefix + ' dimension mismatch (' + str(one_dim) + ' ' + str(two_dim) + ')') + if not image_one.size == image_two.size: + app.debug(debug_prefix + ' dimension mismatch (' + str(image_one.size) + ' ' + str(image_two.size) + ')') return False # Voxel size - one_spacing = [ float(f) for f in headerField(image_one, 'vox').split() ] - two_spacing = [ float(f) for f in headerField(image_two, 'vox').split() ] - for one, two in zip(one_spacing, two_spacing): + for one, two in zip(image_one.spacing, image_two.spacing): if one and two and not math.isnan(one) and not math.isnan(two): if (abs(two-one) / (0.5*(one+two))) > 1e-04: - app.debug(debug_prefix + ' voxel size mismatch (' + str(one_spacing) + ' ' + str(two_spacing) + ')') + app.debug(debug_prefix + ' voxel size mismatch (' + str(image_one.spacing) + ' ' + str(image_two.spacing) + ')') return False # Image transform - one_transform = [ float(f) for f in headerField(image_one, 'transform').replace('\n', ' ').replace(',', ' ').split() ] - two_transform = [ float(f) for f in headerField(image_two, 'transform').replace('\n', ' ').replace(',', ' ').split() ] - for one, two in zip(one_transform, two_transform): - if abs(one-two) > 1e-4: - app.debug(debug_prefix + ' transform mismatch (' + str(one_transform) + ' ' + str(two_transform) + ')') - return False + for line_one, line_two in zip(image_one.transform, image_two.transform): + for one, two in zip(line_one, line_two): + if abs(one-two) > 1e-4: + app.debug(debug_prefix + ' transform mismatch (' + str(image_one.transform) + ' ' + str(image_two.transform) + ')') + return False # Everything matches! app.debug(debug_prefix + ' image match') return True diff --git a/lib/mrtrix3/phaseEncoding.py b/lib/mrtrix3/phaseEncoding.py index 954d633356..c9ff0190e6 100644 --- a/lib/mrtrix3/phaseEncoding.py +++ b/lib/mrtrix3/phaseEncoding.py @@ -47,23 +47,23 @@ def dir(string): -# Extract a phase-encoding acheme from an image header -def getScheme(image_path): - import subprocess - from mrtrix3 import app, run - command = [ run.versionMatch('mrinfo'), image_path, '-petable' ] - if app._verbosity > 1: - app.console('Command: \'' + ' '.join(command) + '\' (piping data to local storage)') - proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=None) - result, err = proc.communicate() - result = result.rstrip().decode('utf-8') - if result: - result = [ [ float(f) for f in line.split() ] for line in result.split('\n') ] - if app._verbosity > 1: - if not result: - app.console('Result: No phase encoding table found') - else: - app.console('Result: ' + str(len(result)) + ' x ' + str(len(result[0])) + ' table') - app.debug(str(result)) - return result +# Extract a phase-encoding scheme from a pre-loaded image header, +# or from a path to the image +def getScheme(input): + from mrtrix3 import app, image + if not isinstance(input, image._Header): + if not input is str: + app.error('Error trying to derive phase-encoding scheme from \'' + str(input) + '\': Not an image header or file path') + input = image.header(input) + if 'pe_scheme' in input.keyval: + app.debug(input.keyval['pe_scheme']) + return input.keyval['pe_scheme'] + if not 'PhaseEncodingDirection' in input.keyval: + return None + line = dir(input.keyval['PhaseEncodingDirection']) + if 'TotalReadoutTime' in input.keyval: + line.append(input.keyval['TotalReadoutTime']) + num_volumes = 1 if len(input.size()) < 4 else input.size[3] + app.debug(str(line) + ' x ' + num_volumes + ' rows') + return line * num_volumes diff --git a/src/dwi/gradient.cpp b/src/dwi/gradient.cpp index c161219703..364664288d 100644 --- a/src/dwi/gradient.cpp +++ b/src/dwi/gradient.cpp @@ -27,7 +27,7 @@ namespace MR { OptionGroup group ("DW gradient table import options"); - group + group + Option ("grad", "Provide the diffusion-weighted gradient scheme used in the acquisition " "in a text file. This should be supplied as a 4xN text file with each line " @@ -44,8 +44,8 @@ namespace MR + Argument ("bvecs").type_file_in() + Argument ("bvals").type_file_in(); - if (include_bvalue_scaling) - group + if (include_bvalue_scaling) + group + Option ("bvalue_scaling", "specifies whether the b-values should be scaled by the square of " "the corresponding DW gradient norm, as often required for " @@ -58,7 +58,7 @@ namespace MR } - OptionGroup GradExportOptions() + OptionGroup GradExportOptions() { return OptionGroup ("DW gradient table export options") @@ -78,15 +78,10 @@ namespace MR Eigen::MatrixXd G; const auto it = header.keyval().find ("dw_scheme"); if (it != header.keyval().end()) { - const auto lines = split_lines (it->second); - for (size_t row = 0; row < lines.size(); ++row) { - const auto values = parse_floats (lines[row]); - if (G.cols() == 0) - G.resize (lines.size(), values.size()); - else if (G.cols() != ssize_t (values.size())) - throw Exception ("malformed DW scheme in image \"" + header.name() + "\" - uneven number of entries per row"); - for (size_t col = 0; col < values.size(); ++col) - G(row, col) = values[col]; + try { + G = parse_matrix (it->second); + } catch (Exception& e) { + throw Exception (e, "malformed DW scheme in image \"" + header.name() + "\""); } } return G; @@ -129,7 +124,7 @@ namespace MR // transform have negative determinant: vector order; auto adjusted_transform = File::NIfTI::adjust_transform (header, order); - if (adjusted_transform.linear().determinant() > 0.0) + if (adjusted_transform.linear().determinant() > 0.0) bvecs.row(0) = -bvecs.row(0); // account for the fact that bvecs are specified wrt original image axes, @@ -178,7 +173,7 @@ namespace MR // bvecs format actually assumes a LHS coordinate system even if image is // stored using RHS - x axis is flipped to make linear 3x3 part of // transform have negative determinant: - if (adjusted_transform.linear().determinant() > 0.0) + if (adjusted_transform.linear().determinant() > 0.0) bvecs.row(0) = -bvecs.row(0); save_matrix (bvecs, bvecs_path); @@ -227,7 +222,7 @@ namespace MR void validate_DW_scheme (Eigen::MatrixXd& grad, const Header& header, bool nofail) { - if (grad.rows() == 0) + if (grad.rows() == 0) throw Exception ("no diffusion encoding information found in image \"" + header.name() + "\""); //CONF option: BValueScaling @@ -240,7 +235,7 @@ namespace MR //CONF the actual b-value. bool scale_bvalues = true; auto opt = App::get_options ("bvalue_scaling"); - if (opt.size()) + if (opt.size()) scale_bvalues = opt[0][0]; else scale_bvalues = File::Config::get_bool ("BValueScaling", scale_bvalues); @@ -260,7 +255,7 @@ namespace MR - void export_grad_commandline (const Header& header) + void export_grad_commandline (const Header& header) { auto check = [](const Header& h) -> const Header& { if (h.keyval().find("dw_scheme") == h.keyval().end()) @@ -269,11 +264,11 @@ namespace MR }; auto opt = get_options ("export_grad_mrtrix"); - if (opt.size()) + if (opt.size()) save_matrix (parse_DW_scheme (check (header)), opt[0][0]); opt = get_options ("export_grad_fsl"); - if (opt.size()) + if (opt.size()) save_bvecs_bvals (check (header), opt[0][0], opt[0][1]); } From dd6d185e24c84f54f86bfbfc1342ef920e1e1905 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 29 Jun 2017 12:31:11 +1000 Subject: [PATCH 014/538] Scripts: Move / rename a couple of functions - file.delTempFile() and file.delTempDir() are now merged into file.delTemporary(). - file.newTempFile() has been moved to path.newTemporary(), to reflect the fact that the function only returns a path, and does not in fact create a file or directory. --- bin/dwipreproc | 20 ++++----- lib/mrtrix3/dwi2response/tax.py | 18 ++++---- lib/mrtrix3/dwi2response/tournier.py | 22 +++++----- lib/mrtrix3/file.py | 61 +++++++--------------------- lib/mrtrix3/image.py | 4 +- lib/mrtrix3/path.py | 42 +++++++++++++++---- 6 files changed, 80 insertions(+), 87 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index d5f20c4931..a807c6823a 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -404,12 +404,12 @@ if do_topup: if crop_option: app.warn('Topup images contain at least one non-even dimension; cropping images for topup compatibility') run.command('mrcrop se_epi.mif topup_in_crop.mif' + crop_option) - file.delTempFile('se_epi.mif') + file.delTemporary('se_epi.mif') topup_in_path = 'topup_in_crop.mif' # Do the conversion in preparation for topup run.command('mrconvert ' + topup_in_path + ' topup_in.nii' + import_topup_pe_table_option + ' -stride -1,+2,+3,+4 -export_pe_table topup_datain.txt') - file.delTempFile(topup_in_path) + file.delTemporary(topup_in_path) # Run topup topup_manual_options = '' @@ -453,7 +453,7 @@ else: # Run eddy run.command('mrconvert dwi.mif' + import_dwi_pe_table_option + ' dwi.nii -stride -1,+2,+3,+4 -export_grad_fsl bvecs bvals -export_pe_eddy eddy_config.txt eddy_indices.txt') -file.delTempFile('dwi.mif') +file.delTemporary('dwi.mif') eddy_manual_options = '' if app.args.eddy_options: eddy_manual_options = ' ' + app.args.eddy_options.strip() @@ -553,7 +553,7 @@ else: if not image.match('topup_in.nii', field_map_image): app.warn('topup output field image has erroneous header; recommend updating FSL to version 5.0.8 or later') run.command('mrtransform ' + field_map_image + ' -replace topup_in.nii field_map_fix' + fsl_suffix) - file.delTempFile(field_map_image) + file.delTemporary(field_map_image) field_map_image = 'field_map_fix' + fsl_suffix @@ -580,9 +580,9 @@ else: run.command('mrcalc ' + field_map_image + ' ' + str(config[3]) + ' -mult' + sign_multiplier + ' - | mrfilter - gradient - | mrconvert - ' + field_derivative_path + ' -coord 3 ' + str(pe_axis) + ' -axes 0,1,2') jacobian_path = 'jacobian_' + str(index+1) + '.mif' run.command('mrcalc 1.0 ' + field_derivative_path + ' -add 0.0 -max ' + jacobian_path) - file.delTempFile(field_derivative_path) + file.delTemporary(field_derivative_path) run.command('mrcalc ' + jacobian_path + ' ' + jacobian_path + ' -mult weight' + str(index+1) + '.mif') - file.delTempFile(jacobian_path) + file.delTemporary(jacobian_path) # This section extracts the two volumes corresponding to each reversed phase-encoded volume pair, and # derives a single image volume based on the recombination equation @@ -594,17 +594,17 @@ else: # Volume recombination equation described in Skare and Bammer 2010 run.command('mrcalc volume0.mif weight' + str(pe_indices[0]) + '.mif -mult volume1.mif weight' + str(pe_indices[1]) + '.mif -mult -add weight' + str(pe_indices[0]) + '.mif weight' + str(pe_indices[1]) + '.mif -add -divide 0.0 -max combined' + str(index) + '.mif') combined_image_list.append('combined' + str(index) + '.mif') - file.delTempFile('volume0.mif') - file.delTempFile('volume1.mif') + file.delTemporary('volume0.mif') + file.delTemporary('volume1.mif') for index in range(0, len(eddy_config)): - file.delTempFile('weight' + str(index+1) + '.mif') + file.delTemporary('weight' + str(index+1) + '.mif') # Finally the recombined volumes must be concatenated to produce the resulting image series run.command('mrcat ' + ' '.join(combined_image_list) + ' - -axis 3 | mrconvert - result.mif -fslgrad bvecs_combined bvals_combined' + stride_option) for path in combined_image_list: - file.delTempFile(path) + file.delTemporary(path) diff --git a/lib/mrtrix3/dwi2response/tax.py b/lib/mrtrix3/dwi2response/tax.py index 006d6e1d44..4f18576377 100644 --- a/lib/mrtrix3/dwi2response/tax.py +++ b/lib/mrtrix3/dwi2response/tax.py @@ -71,28 +71,28 @@ def execute(): run.command('dwi2fod csd dwi.mif ' + RF_in_path + ' ' + prefix + 'FOD.mif -mask ' + mask_in_path) # Get amplitudes of two largest peaks, and directions of largest run.command('fod2fixel ' + prefix + 'FOD.mif ' + prefix + 'fixel -peak peaks.mif -mask ' + mask_in_path + ' -fmls_no_thresholds') - file.delTempFile(prefix + 'FOD.mif') + file.delTemporary(prefix + 'FOD.mif') run.command('fixel2voxel ' + prefix + 'fixel/peaks.mif split_data ' + prefix + 'amps.mif') run.command('mrconvert ' + prefix + 'amps.mif ' + prefix + 'first_peaks.mif -coord 3 0 -axes 0,1,2') run.command('mrconvert ' + prefix + 'amps.mif ' + prefix + 'second_peaks.mif -coord 3 1 -axes 0,1,2') - file.delTempFile(prefix + 'amps.mif') + file.delTemporary(prefix + 'amps.mif') run.command('fixel2voxel ' + prefix + 'fixel/directions.mif split_dir ' + prefix + 'all_dirs.mif') file.delTempFolder(prefix + 'fixel') run.command('mrconvert ' + prefix + 'all_dirs.mif ' + prefix + 'first_dir.mif -coord 3 0:2') - file.delTempFile(prefix + 'all_dirs.mif') + file.delTemporary(prefix + 'all_dirs.mif') # Revise single-fibre voxel selection based on ratio of tallest to second-tallest peak run.command('mrcalc ' + prefix + 'second_peaks.mif ' + prefix + 'first_peaks.mif -div ' + prefix + 'peak_ratio.mif') - file.delTempFile(prefix + 'first_peaks.mif') - file.delTempFile(prefix + 'second_peaks.mif') + file.delTemporary(prefix + 'first_peaks.mif') + file.delTemporary(prefix + 'second_peaks.mif') run.command('mrcalc ' + prefix + 'peak_ratio.mif ' + str(app.args.peak_ratio) + ' -lt ' + mask_in_path + ' -mult ' + prefix + 'SF.mif -datatype bit') - file.delTempFile(prefix + 'peak_ratio.mif') + file.delTemporary(prefix + 'peak_ratio.mif') # Make sure image isn't empty SF_voxel_count = int(image.statistic(prefix + 'SF.mif', 'count', prefix + 'SF.mif')) if not SF_voxel_count: app.error('Aborting: All voxels have been excluded from single-fibre selection') # Generate a new response function run.command('amp2response dwi.mif ' + prefix + 'SF.mif ' + prefix + 'first_dir.mif ' + prefix + 'RF.txt' + lmax_option) - file.delTempFile(prefix + 'first_dir.mif') + file.delTemporary(prefix + 'first_dir.mif') # Detect convergence # Look for a change > some percentage - don't bother looking at the masks @@ -114,8 +114,8 @@ def execute(): run.function(shutil.copyfile, prefix + 'SF.mif', 'voxels.mif') break - file.delTempFile(RF_in_path) - file.delTempFile(mask_in_path) + file.delTemporary(RF_in_path) + file.delTemporary(mask_in_path) # Go to the next iteration # If we've terminated due to hitting the iteration limiter, we still need to copy the output file(s) to the correct location diff --git a/lib/mrtrix3/dwi2response/tournier.py b/lib/mrtrix3/dwi2response/tournier.py index 79236fdb6e..789b837c2c 100644 --- a/lib/mrtrix3/dwi2response/tournier.py +++ b/lib/mrtrix3/dwi2response/tournier.py @@ -61,37 +61,37 @@ def execute(): # TODO Speed-test fod2fixel against sh2peaks # TODO Add maximum number of fixels per voxel option to fod2fixel? run.command('fod2fixel ' + prefix + 'FOD.mif ' + prefix + 'fixel -peak peaks.mif -mask ' + mask_in_path + ' -fmls_no_thresholds') - file.delTempFile(prefix + 'FOD.mif') + file.delTemporary(prefix + 'FOD.mif') if iteration: - file.delTempFile(mask_in_path) + file.delTemporary(mask_in_path) run.command('fixel2voxel ' + prefix + 'fixel/peaks.mif split_data ' + prefix + 'amps.mif -number 2') run.command('mrconvert ' + prefix + 'amps.mif ' + prefix + 'first_peaks.mif -coord 3 0 -axes 0,1,2') run.command('mrconvert ' + prefix + 'amps.mif ' + prefix + 'second_peaks.mif -coord 3 1 -axes 0,1,2') - file.delTempFile(prefix + 'amps.mif') + file.delTemporary(prefix + 'amps.mif') run.command('fixel2voxel ' + prefix + 'fixel/directions.mif split_dir ' + prefix + 'all_dirs.mif -number 1') file.delTempFolder(prefix + 'fixel') run.command('mrconvert ' + prefix + 'all_dirs.mif ' + prefix + 'first_dir.mif -coord 3 0:2') - file.delTempFile(prefix + 'all_dirs.mif') + file.delTemporary(prefix + 'all_dirs.mif') # Calculate the 'cost function' Donald derived for selecting single-fibre voxels # https://github.com/MRtrix3/mrtrix3/pull/426 # sqrt(|peak1|) * (1 - |peak2| / |peak1|)^2 run.command('mrcalc ' + prefix + 'first_peaks.mif -sqrt 1 ' + prefix + 'second_peaks.mif ' + prefix + 'first_peaks.mif -div -sub 2 -pow -mult '+ prefix + 'CF.mif') - file.delTempFile(prefix + 'first_peaks.mif') - file.delTempFile(prefix + 'second_peaks.mif') + file.delTemporary(prefix + 'first_peaks.mif') + file.delTemporary(prefix + 'second_peaks.mif') # Select the top-ranked voxels run.command('mrthreshold ' + prefix + 'CF.mif -top ' + str(app.args.sf_voxels) + ' ' + prefix + 'SF.mif') # Generate a new response function based on this selection run.command('amp2response dwi.mif ' + prefix + 'SF.mif ' + prefix + 'first_dir.mif ' + prefix + 'RF.txt' + iter_lmax_option) - file.delTempFile(prefix + 'first_dir.mif') + file.delTemporary(prefix + 'first_dir.mif') # Should we terminate? if iteration > 0: run.command('mrcalc ' + prefix + 'SF.mif iter' + str(iteration-1) + '_SF.mif -sub ' + prefix + 'SF_diff.mif') - file.delTempFile('iter' + str(iteration-1) + '_SF.mif') + file.delTemporary('iter' + str(iteration-1) + '_SF.mif') max_diff = image.statistic(prefix + 'SF_diff.mif', 'max') - file.delTempFile(prefix + 'SF_diff.mif') + file.delTemporary(prefix + 'SF_diff.mif') if int(max_diff) == 0: app.console('Convergence of SF voxel selection detected at iteration ' + str(iteration)) - file.delTempFile(prefix + 'CF.mif') + file.delTemporary(prefix + 'CF.mif') run.function(shutil.copyfile, prefix + 'RF.txt', 'response.txt') run.function(shutil.move, prefix + 'SF.mif', 'voxels.mif') break @@ -99,7 +99,7 @@ def execute(): # Select a greater number of top single-fibre voxels, and dilate (within bounds of initial mask); # these are the voxels that will be re-tested in the next iteration run.command('mrthreshold ' + prefix + 'CF.mif -top ' + str(app.args.iter_voxels) + ' - | maskfilter - dilate - -npass ' + str(app.args.dilate) + ' | mrcalc mask.mif - -mult ' + prefix + 'SF_dilated.mif') - file.delTempFile(prefix + 'CF.mif') + file.delTemporary(prefix + 'CF.mif') # Commence the next iteration diff --git a/lib/mrtrix3/file.py b/lib/mrtrix3/file.py index 8b43482e9c..943b2485a2 100644 --- a/lib/mrtrix3/file.py +++ b/lib/mrtrix3/file.py @@ -2,33 +2,30 @@ -# These functions can (and should in some instances) be called upon any file / directory +# This function can (and should in some instances) be called upon any file / directory # that is no longer required by the script. If the script has been instructed to retain # all temporaries, the resource will be retained; if not, it will be deleted (in particular # to dynamically free up storage space used by the script). -def delTempFile(path): - import os +def delTemporary(path): + import shutil, os from mrtrix3 import app if not app._cleanup: return - if app._verbosity > 2: - app.console('Deleting temporary file: ' + path) - try: - os.remove(path) - except OSError: - app.debug('Unable to delete temporary file ' + path) - -def delTempFolder(path): - import shutil - from mrtrix3 import app - if not app._cleanup: + if os.path.isfile(path): + type = 'file' + func = os.remove + elif os.path.isdir(path): + type = 'directory' + func = shutil.rmtree + else: + app.debug('Unknown target \'' + path + '\'') return if app._verbosity > 2: - app.console('Deleting temporary folder: ' + path) + app.console('Deleting temporary ' + type + ': \'' + path + '\'') try: - shutil.rmtree(path) + func(path) except OSError: - app.debug('Unable to delete temprary folder ' + path) + app.debug('Unable to delete temporary ' + type + ': \'' + path + '\'') @@ -42,35 +39,7 @@ def makeDir(path): except OSError as exception: if exception.errno != errno.EEXIST: raise - app.debug('Directory ' + path + ' already exists') - - - -# Get an appropriate location and name for a new temporary file -# Note: Doesn't actually create a file; just gives a unique name that won't over-write anything -def newTempFile(suffix): - import os, random, string, sys - from mrtrix3 import app - if 'TmpFileDir' in app.config: - dir_path = app.config['TmpFileDir'] - elif app._tempDir: - dir_path = app._tempDir - else: - dir_path = os.getcwd() - if 'TmpFilePrefix' in app.config: - prefix = app.config['TmpFilePrefix'] - else: - prefix = 'mrtrix-tmp-' - full_path = dir_path - if suffix: - suffix = suffix.lstrip('.') - else: - suffix = 'mif' - while os.path.exists(full_path): - random_string = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(6)) - full_path = os.path.join(dir_path, prefix + random_string + '.' + suffix) - app.debug(full_path) - return full_path + app.debug('Directory \'' + path + '\' already exists') diff --git a/lib/mrtrix3/image.py b/lib/mrtrix3/image.py index b49eee34bc..87d681907d 100644 --- a/lib/mrtrix3/image.py +++ b/lib/mrtrix3/image.py @@ -19,8 +19,8 @@ def check3DNonunity(image_path): class _Header: def __init__(self, image_path): import json, os, subprocess, tempfile - from mrtrix3 import app, file, run - filename = file.newTempFile('json') + from mrtrix3 import app, path, run + filename = path.newTemporary('json') command = [ run.exeName(run.versionMatch('mrinfo')), image_path, '-json_all', filename ] if app._verbosity > 1: app.console('Loading header for image file \'' + image_path + '\'') diff --git a/lib/mrtrix3/path.py b/lib/mrtrix3/path.py index db2be1855b..54a010b36a 100644 --- a/lib/mrtrix3/path.py +++ b/lib/mrtrix3/path.py @@ -40,16 +40,28 @@ def fromUser(filename, is_command): -# Get the full absolute path to a location in the temporary script directory -def toTemp(filename, is_command): - import os +# Get an appropriate location and name for a new temporary file / directory +# Note: Doesn't actually create anything; just gives a unique name that won't over-write anything +def newTemporary(suffix): + import os, random, string, sys from mrtrix3 import app - wrapper='' - if is_command and filename.count(' '): - wrapper='\"' - path = wrapper + os.path.abspath(os.path.join(app._tempDir, filename)) + wrapper - app.debug(filename + ' -> ' + path) - return path + if 'TmpFileDir' in app.config: + dir_path = app.config['TmpFileDir'] + elif app._tempDir: + dir_path = app._tempDir + else: + dir_path = os.getcwd() + if 'TmpFilePrefix' in app.config: + prefix = app.config['TmpFilePrefix'] + else: + prefix = 'mrtrix-tmp-' + full_path = dir_path + suffix = suffix.lstrip('.') + while os.path.exists(full_path): + random_string = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(6)) + full_path = os.path.join(dir_path, prefix + random_string + '.' + suffix) + app.debug(full_path) + return full_path @@ -73,3 +85,15 @@ def sharedDataPath(): import os return os.path.realpath(os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir, os.pardir, 'share', 'mrtrix3'))) + + +# Get the full absolute path to a location in the temporary script directory +def toTemp(filename, is_command): + import os + from mrtrix3 import app + wrapper='' + if is_command and filename.count(' '): + wrapper='\"' + path = wrapper + os.path.abspath(os.path.join(app._tempDir, filename)) + wrapper + app.debug(filename + ' -> ' + path) + return path From c07043e1347682def948a7be4d2f0fc8c3004c3d Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 29 Jun 2017 16:27:17 +1000 Subject: [PATCH 015/538] fsl.eddyBinary(): Search for eddy_cuda with version number Also fixes a couple of little bugs from prior changes to image header importing in Python. --- lib/mrtrix3/fsl.py | 26 +++++++++++++++++++++++++- lib/mrtrix3/image.py | 2 +- lib/mrtrix3/phaseEncoding.py | 2 +- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/lib/mrtrix3/fsl.py b/lib/mrtrix3/fsl.py index 45c132dad4..4e27e7b17a 100644 --- a/lib/mrtrix3/fsl.py +++ b/lib/mrtrix3/fsl.py @@ -10,9 +10,33 @@ def eddyBinary(cuda): from distutils.spawn import find_executable if cuda: if find_executable('eddy_cuda'): - app.debug('Selecting CUDA version of eddy') + app.debug('Selected CUDA version (eddy_cuda)') return 'eddy_cuda' else: + # Cuda versions are now provided with a CUDA trailing version number + # Users may not necessarily create a softlink to one of these and + # call it "eddy_cuda" + # Therefore, hunt through PATH looking for them; if more than one, + # select the one with the highest version number + binaries = [ ] + for dir in os.environ['PATH'].split(os.pathsep): + if os.path.isdir(dir): + for file in os.listdir(dir): + if file.startswith('eddy_cuda'): + binaries.append(file) + max_version = 0.0 + path = '' + for file in binaries: + try: + version = float(file.lstrip('eddy_cuda')) + if version > max_version: + max_version = version + path = file + except: + pass + if path: + app.debug('CUDA version ' + str(max_version) + ': ' + path) + return path app.warn('CUDA version of eddy not found; running standard version') if find_executable('eddy_openmp'): path = 'eddy_openmp' diff --git a/lib/mrtrix3/image.py b/lib/mrtrix3/image.py index 87d681907d..dce8524fba 100644 --- a/lib/mrtrix3/image.py +++ b/lib/mrtrix3/image.py @@ -5,7 +5,7 @@ def check3DNonunity(image_path): from mrtrix3 import app - dim = [ int(i) for i in headerField(image_path, 'size').strip().split() ] + dim = header(image_path).size if len(dim) < 3: app.error('Image \'' + image_path + '\' does not contain 3 spatial dimensions') if min(dim) == 1: diff --git a/lib/mrtrix3/phaseEncoding.py b/lib/mrtrix3/phaseEncoding.py index c9ff0190e6..b2e061f4e6 100644 --- a/lib/mrtrix3/phaseEncoding.py +++ b/lib/mrtrix3/phaseEncoding.py @@ -52,7 +52,7 @@ def dir(string): def getScheme(input): from mrtrix3 import app, image if not isinstance(input, image._Header): - if not input is str: + if not (type(input) is str): app.error('Error trying to derive phase-encoding scheme from \'' + str(input) + '\': Not an image header or file path') input = image.header(input) if 'pe_scheme' in input.keyval: From 3cefd210b4bfad280e8bee18a3593038a7300393 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 3 Jul 2017 12:18:04 +1000 Subject: [PATCH 016/538] tckgen: Move iFOD2-specific options to option group --- cmd/tckgen.cpp | 5 ++ docs/concepts/dw_scheme.rst | 12 +++-- docs/reference/commands/tckgen.rst | 11 ++-- lib/mrtrix3/app.py | 2 +- src/dwi/tractography/algorithms/iFOD2.cpp | 53 +++++++++++++++++++ src/dwi/tractography/algorithms/iFOD2.h | 6 +++ .../tractography/tracking/tractography.cpp | 15 ------ src/dwi/tractography/tracking/tractography.h | 2 +- 8 files changed, 82 insertions(+), 24 deletions(-) create mode 100644 src/dwi/tractography/algorithms/iFOD2.cpp diff --git a/cmd/tckgen.cpp b/cmd/tckgen.cpp index f508ee5159..80fe9ec9e2 100644 --- a/cmd/tckgen.cpp +++ b/cmd/tckgen.cpp @@ -205,6 +205,8 @@ void usage () + DWI::Tractography::ACT::ACTOption + + DWI::Tractography::Algorithms::iFOD2Option + + DWI::GradImportOptions(); } @@ -233,6 +235,9 @@ void run () Seeding::load_seed_mechanisms (properties); Seeding::load_seed_parameters (properties); + if (algorithm == 2) + Algorithms::load_iFOD2_options (properties); + // Check validity of options -select and -seeds; these are meaningless if seeds are number-limited // By over-riding the values in properties, the progress bar should still be valid if (properties.seeds.is_finite()) { diff --git a/docs/concepts/dw_scheme.rst b/docs/concepts/dw_scheme.rst index bba796f252..70af330e71 100644 --- a/docs/concepts/dw_scheme.rst +++ b/docs/concepts/dw_scheme.rst @@ -346,6 +346,12 @@ introduce minor variations in the *b*-values for other datasets, due to minor rounding errors in the components of the direction vectors. These are benign, and have no consequence on the correct operation of *MRtrix3* applications, since the deviations are typically very small, and the strategy used to group -*b*-values into shells is robust to such variations. If however this becomes a -problem (e.g. for third-party applications), this feature can be disabled -using the ``-bvalue_scaling`` option for those applications that support it. +*b*-values into shells is robust to such variations. Alternatively, if the +provided diffusion gradient table is malformed, and contains the correct +*b*-values but non-unity-norm directions, this scaling will result in a +reported diffusion gradient table that contains *b*-values other than those +expected. + +If this scaling becomes a problem (e.g. for third-party applications), this +feature can be disabled using the ``-bvalue_scaling`` option for those +applications that support it. diff --git a/docs/reference/commands/tckgen.rst b/docs/reference/commands/tckgen.rst index cefee14e20..b56b0a9017 100644 --- a/docs/reference/commands/tckgen.rst +++ b/docs/reference/commands/tckgen.rst @@ -65,10 +65,6 @@ Streamlines tractography options - **-noprecomputed** do NOT pre-compute legendre polynomial values. Warning: this will slow down the algorithm by a factor of approximately 4. -- **-power value** raise the FOD to the power specified (default is 1/nsamples). - -- **-samples number** set the number of FOD samples to take per step for the 2nd order (iFOD2) method (Default: 4). - - **-rk4** use 4th-order Runge-Kutta integration (slower, but eliminates curvature overshoot in 1st-order deterministic methods) - **-stop** stop propagating a streamline once it has traversed all include regions @@ -125,6 +121,13 @@ Anatomically-Constrained Tractography options - **-crop_at_gmwmi** crop streamline endpoints more precisely as they cross the GM-WM interface +Options specific to the iFOD2 tracking algorithm +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- **-samples number** set the number of FOD samples to take per step (Default: 4). + +- **-power value** raise the FOD to the power specified (default is 1/nsamples). + DW gradient table import options ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index 9ace7c2561..a90de64379 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -7,7 +7,7 @@ # - cmdline.addCitation(), cmdline.addDescription(), cmdline.setCopyright() as needed # - Add arguments and options to 'cmdline' as needed # - parse() -# - checkOutputFile() as needed +# - checkOutputPath() as needed # - makeTempDir() if the script requires a temporary directory # - gotoTempDir() if the script is using a temporary directory # - complete() diff --git a/src/dwi/tractography/algorithms/iFOD2.cpp b/src/dwi/tractography/algorithms/iFOD2.cpp new file mode 100644 index 0000000000..c3abf21cb9 --- /dev/null +++ b/src/dwi/tractography/algorithms/iFOD2.cpp @@ -0,0 +1,53 @@ +/* Copyright (c) 2008-2017 the MRtrix3 contributors + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * + * MRtrix is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * For more details, see http://www.mrtrix.org/. + */ + + +#include "dwi/tractography/algorithms/iFOD2.h" + + +namespace MR +{ + namespace DWI + { + namespace Tractography + { + namespace Algorithms + { + + using namespace App; + + const OptionGroup iFOD2Option = OptionGroup ("Options specific to the iFOD2 tracking algorithm") + + + Option ("samples", + "set the number of FOD samples to take per step (Default: " + str(TCKGEN_DEFAULT_IFOD2_NSAMPLES) + ").") + + Argument ("number").type_integer (2, 100) + + + Option ("power", "raise the FOD to the power specified (default is 1/nsamples).") + + Argument ("value").type_float (0.0); + + + void load_iFOD2_options (Tractography::Properties& properties) + { + auto opt = get_options ("samples"); + if (opt.size()) properties["samples_per_step"] = str (opt[0][0]); + + opt = get_options ("power"); + if (opt.size()) properties["fod_power"] = str (opt[0][0]); + } + + } + } + } +} + + diff --git a/src/dwi/tractography/algorithms/iFOD2.h b/src/dwi/tractography/algorithms/iFOD2.h index 8fe40d08f7..6b4ca93f88 100644 --- a/src/dwi/tractography/algorithms/iFOD2.h +++ b/src/dwi/tractography/algorithms/iFOD2.h @@ -18,6 +18,7 @@ #include #include "math/SH.h" +#include "dwi/tractography/properties.h" #include "dwi/tractography/tracking/method.h" #include "dwi/tractography/tracking/shared.h" #include "dwi/tractography/tracking/tractography.h" @@ -25,6 +26,8 @@ #include "dwi/tractography/algorithms/calibrator.h" +#define TCKGEN_DEFAULT_IFOD2_NSAMPLES 4 + namespace MR @@ -36,6 +39,9 @@ namespace MR namespace Algorithms { + extern const App::OptionGroup iFOD2Option; + void load_iFOD2_options (Tractography::Properties&); + using namespace MR::DWI::Tractography::Tracking; class iFOD2 : public MethodBase { MEMALIGN(iFOD2) diff --git a/src/dwi/tractography/tracking/tractography.cpp b/src/dwi/tractography/tracking/tractography.cpp index 8b1537733a..51a60d63dc 100644 --- a/src/dwi/tractography/tracking/tractography.cpp +++ b/src/dwi/tractography/tracking/tractography.cpp @@ -72,15 +72,6 @@ namespace MR "do NOT pre-compute legendre polynomial values. Warning: " "this will slow down the algorithm by a factor of approximately 4.") - + Option ("power", - "raise the FOD to the power specified (default is 1/nsamples).") - + Argument ("value").type_float (0.0) - - + Option ("samples", - "set the number of FOD samples to take per step for the 2nd order " - "(iFOD2) method (Default: " + str(TCKGEN_DEFAULT_IFOD2_NSAMPLES) + ").") - + Argument ("number").type_integer (2, 100) - + Option ("rk4", "use 4th-order Runge-Kutta integration " "(slower, but eliminates curvature overshoot in 1st-order deterministic methods)") @@ -121,12 +112,6 @@ namespace MR opt = get_options ("noprecomputed"); if (opt.size()) properties["sh_precomputed"] = "0"; - opt = get_options ("power"); - if (opt.size()) properties["fod_power"] = std::string (opt[0][0]); - - opt = get_options ("samples"); - if (opt.size()) properties["samples_per_step"] = str (opt[0][0]); - opt = get_options ("rk4"); if (opt.size()) properties["rk4"] = "1"; diff --git a/src/dwi/tractography/tracking/tractography.h b/src/dwi/tractography/tracking/tractography.h index ba3d2281c5..e8a509ea72 100644 --- a/src/dwi/tractography/tracking/tractography.h +++ b/src/dwi/tractography/tracking/tractography.h @@ -25,7 +25,7 @@ #define TCKGEN_DEFAULT_MAX_ATTEMPTS_PER_SEED 1000 #define TCKGEN_DEFAULT_CUTOFF 0.1 #define TCKGEN_DEFAULT_MAX_TRIALS_PER_STEP 1000 -#define TCKGEN_DEFAULT_IFOD2_NSAMPLES 4 + namespace MR From 394dcc736882aba76e09b66b18a4d5392b7421ee Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 4 Jul 2017 12:49:27 +1000 Subject: [PATCH 017/538] Scripts: Cleaning up after changes to temp path handling --- bin/labelsgmfix | 4 +--- cmd/mrinfo.cpp | 4 ++-- lib/mrtrix3/file.py | 27 +++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/bin/labelsgmfix b/bin/labelsgmfix index b1488b5913..6faa48bdcc 100755 --- a/bin/labelsgmfix +++ b/bin/labelsgmfix @@ -8,7 +8,6 @@ # node indices that correspond to these structures, and replaces them with estimates # derived from FIRST. - # Make the corresponding MRtrix3 Python libraries available import inspect, os, sys lib_folder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], os.pardir, 'lib'))) @@ -18,7 +17,6 @@ if not os.path.isdir(lib_folder): sys.path.insert(0, lib_folder) - from distutils.spawn import find_executable from mrtrix3 import app, image, path, run @@ -60,7 +58,7 @@ if not os.path.isdir(first_atlas_path): # Want a mapping between FreeSurfer node names and FIRST structure names # Just deal with the 5 that are used in ACT; FreeSurfer's hippocampus / amygdala segmentations look good enough. -structure_map = { 'L_Accu':'Left-Accumbens-area', 'R_Accu':'Right-Accumbens-area', +structure_map = { 'L_Accu':'Left-Accumbens-area', 'R_Accu':'Right-Accumbens-area', 'L_Caud':'Left-Caudate', 'R_Caud':'Right-Caudate', 'L_Pall':'Left-Pallidum', 'R_Pall':'Right-Pallidum', 'L_Puta':'Left-Putamen', 'R_Puta':'Right-Putamen', diff --git a/cmd/mrinfo.cpp b/cmd/mrinfo.cpp index 2e9176025a..5f9b86a797 100644 --- a/cmd/mrinfo.cpp +++ b/cmd/mrinfo.cpp @@ -31,7 +31,6 @@ using namespace App; const OptionGroup GradImportOptions = DWI::GradImportOptions(); const OptionGroup GradExportOptions = DWI::GradExportOptions(); - const OptionGroup FieldExportOptions = OptionGroup ("Options for exporting image header fields") + Option ("property", "any text properties embedded in the image header under the " @@ -45,6 +44,7 @@ const OptionGroup FieldExportOptions = OptionGroup ("Options for exporting image + Argument ("file").type_file_out(); + void usage () { @@ -81,7 +81,7 @@ void usage () + Option ("multiplier", "image intensity multiplier") + Option ("transform", "the voxel to image transformation") - + NoRealignOption + + NoRealignOption + FieldExportOptions diff --git a/lib/mrtrix3/file.py b/lib/mrtrix3/file.py index 943b2485a2..8cbbd1c0d9 100644 --- a/lib/mrtrix3/file.py +++ b/lib/mrtrix3/file.py @@ -43,6 +43,33 @@ def makeDir(path): +# Get an appropriate location and name for a new temporary file +# Note: Doesn't actually create a file; just gives a unique name that won't over-write anything +def newTempFile(suffix): + import os, random, string, sys + from mrtrix3 import app + if 'TmpFileDir' in app.config: + dir_path = app.config['TmpFileDir'] + elif app._tempDir: + dir_path = app._tempDir + else: + dir_path = os.getcwd() + app.debug(dir_path) + if 'TmpFilePrefix' in app.config: + prefix = app.config['TmpFilePrefix'] + else: + prefix = 'mrtrix-tmp-' + app.debug(prefix) + full_path = dir_path + suffix = suffix.lstrip('.') + while os.path.exists(full_path): + random_string = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(6)) + full_path = os.path.join(dir_path, prefix + random_string + '.' + suffix) + app.debug(full_path) + return full_path + + + # Wait until a particular file not only exists, but also does not have any # other process operating on it (so hopefully whatever created it has # finished its work) From 9bffe1f75856a686e6c990dfcfc984b5f5ca0f59 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 4 Jul 2017 13:02:25 +1000 Subject: [PATCH 018/538] mrconvert: Neaten function call for copy operation --- cmd/mrconvert.cpp | 61 ++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/cmd/mrconvert.cpp b/cmd/mrconvert.cpp index 62e064a8d9..48154a6c12 100644 --- a/cmd/mrconvert.cpp +++ b/cmd/mrconvert.cpp @@ -30,16 +30,16 @@ using namespace App; void usage () { - AUTHOR = "J-Donald Tournier (jdtournier@gmail.com)"; + AUTHOR = "J-Donald Tournier (jdtournier@gmail.com) and Robert E. Smith (robert.smith@florey.edu.au)"; SYNOPSIS = "Perform conversion between different file types and optionally " - "extract a subset of the input image"; + "extract a subset of the input image"; -DESCRIPTION + DESCRIPTION + "If used correctly, this program can be a very useful workhorse. " - "In addition to converting images between different formats, it can " - "be used to extract specific studies from a data set, extract a " - "specific region of interest, or flip the images."; + "In addition to converting images between different formats, it can " + "be used to extract specific studies from a data set, extract a " + "specific region of interest, or flip the images."; ARGUMENTS + Argument ("input", "the input image.").type_image_in () @@ -214,36 +214,33 @@ inline vector set_header (Header& header, const ImageType& input) -template -inline void copy_permute (Header& header_in, Header& header_out, const vector>& pos, const std::string& output_filename) + +template +void copy_permute (const InputType& in, Header& header_out, const std::string& output_filename) { + const auto axes = set_header (header_out, in); + auto out = Image::create (output_filename, header_out); + DWI::export_grad_commandline (out); + PhaseEncoding::export_commandline (out); + auto perm = Adapter::make (in, axes); + threaded_copy_with_progress (perm, out, 0, std::numeric_limits::max(), 2); +} - auto in = header_in.get_image(); - if (pos.empty()) { - const auto axes = set_header (header_out, in); - auto out = Header::create (output_filename, header_out).get_image(); - DWI::export_grad_commandline (out); - PhaseEncoding::export_commandline (out); - auto perm = Adapter::make (in, axes); - threaded_copy_with_progress (perm, out, 0, std::numeric_limits::max(), 2); +template +void extract (Header& header_in, Header& header_out, const std::vector>& pos, const std::string& output_filename) +{ + auto in = header_in.get_image(); + if (pos.empty()) { + copy_permute (in, header_out, output_filename); } else { - auto extract = Adapter::make (in, pos); - const auto axes = set_header (header_out, extract); - auto out = Image::create (output_filename, header_out); - DWI::export_grad_commandline (out); - PhaseEncoding::export_commandline (out); - - auto perm = Adapter::make (extract, axes); - threaded_copy_with_progress (perm, out, 0, std::numeric_limits::max(), 2); - + copy_permute (extract, header_out, output_filename); } - } @@ -378,15 +375,15 @@ void run () case DataType::UInt16: case DataType::UInt32: if (header_out.datatype().is_signed()) - copy_permute (header_in, header_out, pos, argument[1]); + extract (header_in, header_out, pos, argument[1]); else - copy_permute (header_in, header_out, pos, argument[1]); + extract (header_in, header_out, pos, argument[1]); break; case DataType::UInt64: if (header_out.datatype().is_signed()) - copy_permute (header_in, header_out, pos, argument[1]); + extract (header_in, header_out, pos, argument[1]); else - copy_permute (header_in, header_out, pos, argument[1]); + extract (header_in, header_out, pos, argument[1]); break; case DataType::Undefined: throw Exception ("invalid output image data type"); break; @@ -394,9 +391,9 @@ void run () } else { if (header_out.datatype().is_complex()) - copy_permute (header_in, header_out, pos, argument[1]); + extract (header_in, header_out, pos, argument[1]); else - copy_permute (header_in, header_out, pos, argument[1]); + extract (header_in, header_out, pos, argument[1]); } From 1fe209be76b310dfdc9ac22e0f2aea809c20f292 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 4 Jul 2017 13:07:12 +1000 Subject: [PATCH 019/538] mrdump: Remove erroneous TRACE call --- cmd/mrdump.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/mrdump.cpp b/cmd/mrdump.cpp index 3e87d3553d..0d39703229 100644 --- a/cmd/mrdump.cpp +++ b/cmd/mrdump.cpp @@ -47,7 +47,6 @@ void usage () template void write (Image& image, StreamType& out) { - TRACE; for (auto l = Loop(image) (image); l; ++l) out << image.value() << "\n"; } From e3f1c05f19cf320c70ad76ca81877895fbcfe907 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 4 Jul 2017 13:13:59 +1000 Subject: [PATCH 020/538] Docs: Fix link in ISMRM 2015 HCP tutorial --- .../quantitative_structural_connectivity/ismrm_hcp_tutorial.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quantitative_structural_connectivity/ismrm_hcp_tutorial.rst b/docs/quantitative_structural_connectivity/ismrm_hcp_tutorial.rst index 44a9ca8f18..5577a2668f 100644 --- a/docs/quantitative_structural_connectivity/ismrm_hcp_tutorial.rst +++ b/docs/quantitative_structural_connectivity/ismrm_hcp_tutorial.rst @@ -164,7 +164,7 @@ hardware can successfully execute the :ref:`tcksift` command, e.g.: ``tckedit 100M.tck 50M.tck -number 50M`` Alternatively, if you're feeling brave, you can give -`SIFT2 `__ a try... +`SIFT2 `__ a try... 3. Map streamlines to the parcellated image to produce a connectome: From e577a8788c2e69feb420f81359a18473b4340aae Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 4 Jul 2017 13:18:16 +1000 Subject: [PATCH 021/538] Rename -shell option to -shells for relevant DWI commands --- docs/reference/commands/amp2sh.rst | 4 ++-- docs/reference/commands/dwi2fod.rst | 4 ++-- docs/reference/commands/dwi2noise.rst | 4 ++-- docs/reference/commands/dwiextract.rst | 4 ++-- src/dwi/shells.cpp | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/reference/commands/amp2sh.rst b/docs/reference/commands/amp2sh.rst index 75b8def22c..572ef1ec28 100644 --- a/docs/reference/commands/amp2sh.rst +++ b/docs/reference/commands/amp2sh.rst @@ -47,10 +47,10 @@ DW gradient table import options - **-bvalue_scaling mode** specifies whether the b-values should be scaled by the square of the corresponding DW gradient norm, as often required for multi-shell or DSI DW acquisition schemes. The default action can also be set in the MRtrix config file, under the BValueScaling entry. Valid choices are yes/no, true/false, 0/1 (default: true). -DW Shell selection options +DW shell selection options ^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shell list** specify one or more diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. +- **-shells list** specify one (or more) diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. Stride options ^^^^^^^^^^^^^^ diff --git a/docs/reference/commands/dwi2fod.rst b/docs/reference/commands/dwi2fod.rst index 131cc2bcf5..4267ef8e25 100644 --- a/docs/reference/commands/dwi2fod.rst +++ b/docs/reference/commands/dwi2fod.rst @@ -36,10 +36,10 @@ DW gradient table import options - **-bvalue_scaling mode** specifies whether the b-values should be scaled by the square of the corresponding DW gradient norm, as often required for multi-shell or DSI DW acquisition schemes. The default action can also be set in the MRtrix config file, under the BValueScaling entry. Valid choices are yes/no, true/false, 0/1 (default: true). -DW Shell selection options +DW shell selection options ^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shell list** specify one or more diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. +- **-shells list** specify one (or more) diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. Options common to more than one algorithm ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/reference/commands/dwi2noise.rst b/docs/reference/commands/dwi2noise.rst index f3983ed633..211bb88f5b 100644 --- a/docs/reference/commands/dwi2noise.rst +++ b/docs/reference/commands/dwi2noise.rst @@ -37,10 +37,10 @@ DW gradient table import options - **-bvalue_scaling mode** specifies whether the b-values should be scaled by the square of the corresponding DW gradient norm, as often required for multi-shell or DSI DW acquisition schemes. The default action can also be set in the MRtrix config file, under the BValueScaling entry. Valid choices are yes/no, true/false, 0/1 (default: true). -DW Shell selection options +DW shell selection options ^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shell list** specify one or more diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. +- **-shells list** specify one (or more) diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. Standard options ^^^^^^^^^^^^^^^^ diff --git a/docs/reference/commands/dwiextract.rst b/docs/reference/commands/dwiextract.rst index c306294cb9..d99afec634 100644 --- a/docs/reference/commands/dwiextract.rst +++ b/docs/reference/commands/dwiextract.rst @@ -36,10 +36,10 @@ DW gradient table import options - **-bvalue_scaling mode** specifies whether the b-values should be scaled by the square of the corresponding DW gradient norm, as often required for multi-shell or DSI DW acquisition schemes. The default action can also be set in the MRtrix config file, under the BValueScaling entry. Valid choices are yes/no, true/false, 0/1 (default: true). -DW Shell selection options +DW shell selection options ^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shell list** specify one or more diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. +- **-shells list** specify one (or more) diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. Options for importing phase-encode tables ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/dwi/shells.cpp b/src/dwi/shells.cpp index b8a070321a..81d279f901 100644 --- a/src/dwi/shells.cpp +++ b/src/dwi/shells.cpp @@ -24,9 +24,9 @@ namespace MR namespace DWI { - const App::OptionGroup ShellOption = App::OptionGroup ("DW Shell selection options") - + App::Option ("shell", - "specify one or more diffusion-weighted gradient shells to use during " + const App::OptionGroup ShellOption = App::OptionGroup ("DW shell selection options") + + App::Option ("shells", + "specify one (or more) diffusion-weighted gradient shells to use during " "processing, as a comma-separated list of the desired approximate b-values. " "Note that some commands are incompatible with multiple shells, and " "will throw an error if more than one b-value is provided.") From 826366e62411fc0da0af5265ea5a8cac96e20fa2 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 4 Jul 2017 13:30:11 +1000 Subject: [PATCH 022/538] Docs: Minor changes to dwipreproc introduction --- docs/getting_started/beginner_dwi_tutorial.rst | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/getting_started/beginner_dwi_tutorial.rst b/docs/getting_started/beginner_dwi_tutorial.rst index 4e9fc4f16f..d166306d91 100644 --- a/docs/getting_started/beginner_dwi_tutorial.rst +++ b/docs/getting_started/beginner_dwi_tutorial.rst @@ -20,9 +20,15 @@ this can be used to correct the susceptibility-induced geometric distortions present in the diffusion images, as well as any eddy current-induced distortions and inter-volume subject motion. Procedures for this correct are not yet implemented in *MRtrix3*, though we do provide -a script called ``dwipreproc`` for interfacing with the relevant FSL tools. -Due to the nuances of the operation of this script, the reader is referred -to the :ref:`dwipreproc_page` page. +a script for interfacing with the relevant FSL tools: + +``dwipreproc [options]`` + +For more details, see the :ref:`dwipreproc` help file. In +particular, it is necessary to manually specify what type of reversed +phase-encoding acquisition has taken place (if any), and potentially +provide additional relevant input images or provide details of the +phase encoding scheme used in the acquisition. DWI brain mask estimation ~~~~~~~~~~~~~~~~~~~~~~~~~ From d155d6e265e13c176e1d58b9666651103b641dac Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 4 Jul 2017 13:36:58 +1000 Subject: [PATCH 023/538] tck2connectome: Clarify -out_assignments option; add -zero_diagonal option --- cmd/tck2connectome.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/tck2connectome.cpp b/cmd/tck2connectome.cpp index 56ac1219db..942febf725 100644 --- a/cmd/tck2connectome.cpp +++ b/cmd/tck2connectome.cpp @@ -69,6 +69,11 @@ void usage () "this can be used subsequently e.g. by the command connectome2tck") + Argument ("path").type_file_out() + + Option ("zero_diagonal", "set all diagonal entries in the matrix to zero \n" + "(these represent streamlines that connect to the same node at both ends)") + + // TODO Option to make matrix symmetric before output + + Option ("vector", "output a vector representing connectivities from a given seed point to target nodes, " "rather than a matrix of node-node connectivities"); From a126c58fb9afef9c50ac764d88b91aa0c854643d Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 4 Jul 2017 13:41:03 +1000 Subject: [PATCH 024/538] mrcalc: New ternary operator -replace This kind of operation would usually be achieved by performing some type of comparison in order to produce a mask, then multiplying the mask by the desired value; this -replace option may be more intuitive in some circumstances. --- cmd/mrcalc.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/mrcalc.cpp b/cmd/mrcalc.cpp index b4caaf91a3..156e5d514c 100644 --- a/cmd/mrcalc.cpp +++ b/cmd/mrcalc.cpp @@ -128,6 +128,7 @@ OPTIONS + OptionGroup ("Ternary operators") + Option ("if", "if first operand is true (non-zero), return second operand, otherwise return third operand").allow_multiple() + + Option ("replace", "Wherever first operand is equal to the second operand, replace with third operand").allow_multiple() + DataType::options(); @@ -1047,6 +1048,13 @@ class OpIf : public OpTernary { NOMEMALIGN complex_type Z (complex_type a, complex_type b, complex_type c) const { return a.real() ? b : c; } }; +class OpReplace : public OpTernary { + public: + OpIf () : OpTernary ("(%1, %2 -> %3)") { } + complex_type R (real_type a, real_type b, real_type c) const { return ((a==b) || (std::isnan(a) && std::isnan(b))) ? c : a; } + complex_type Z (complex_type a, complex_type b, complex_type c) const { return (a==b) ? c : a; } +}; + /********************************************************************** @@ -1114,6 +1122,7 @@ void run () { else if (opt->is ("complex")) binary_operation (opt->id, stack, OpComplex()); else if (opt->is ("if")) ternary_operation (opt->id, stack, OpIf()); + else if (opt->is ("replace")) ternary_operation (opt->id, stack, OpReplace()); else if (opt->is ("datatype")) ++n; else if (opt->is ("nthreads")) ++n; From f21f8f810f83893e231b3930825f9e908324b994 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 12 Jul 2017 18:31:49 +1000 Subject: [PATCH 025/538] dwipreproc: Initial work towards topup/eddy common space --- bin/dwipreproc | 71 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 4 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 8802f4d5ae..1bc36a81b7 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -299,7 +299,7 @@ else: # This may be required by -rpe_all for extracting b=0 volumes while retaining phase-encoding information import_dwi_pe_table_option = '' -if dwi_manual_pe_scheme: +if overwrite_dwi_pe_scheme: with open('dwi_manual_pe_scheme.txt', 'w') as f: for line in dwi_manual_pe_scheme: f.write(' '.join( [ str(value) for value in line ] ) + '\n') @@ -309,6 +309,7 @@ if dwi_manual_pe_scheme: # Deal with the phase-encoding of the images to be fed to topup (if applicable) overwrite_topup_pe_scheme = False +topup_in_path = 'topup_in.mif' if app.args.se_epi: # 3 possible sources of PE information: DWI header, topup image header, command-line @@ -361,6 +362,68 @@ if app.args.se_epi: if not topup_pe_scheme: app.error('No phase-encoding information present in SE EPI image header'); + # If we are using the -se_epi option, and hence the input images to topup have not come from the DWIs themselves, + # we need to insert the first b=0 DWI volume to the start of the topup input image + # Additionally: + # - If the input to topup is currently balanced in terms of phase encoding, and insertion of this volume is therefore + # unbalancing the input, and we can find an existing volume in the SE_EPI image with the same phase encoding as the + # first DWI, remove that volume from the input to topup + # - TODO If the DWI is defined on a different voxel grid to the SE-EPI image, it will be necessary to re-grid the SE-EPI + # data to match the DWI + # - Ideally, it would also be preferable to somehow quantify the overall image contrast between the b=0 image, and the SE-EPI + # images, and instead use a registration-based solution. However I think this can wait for now, given I don't know of + # anybody using such an acquisition. + # - TODO The first b=0 volume in the DWIs should also be the first volume of the DWI series; is basically always the case, but + # it wouuld nevertheless be preferable to test for this + + bzero_threshold = 10.0 + if ['BZeroThreshold'] in app.config: + bzero_threshold = float(app.config['BZeroThreshold']) + dwi_first_bzero_index = 0 + for line in grad: + if line[3] <= bzero_threshold: + break + dwi_first_bzero_index += 1 + if dwi_first_bzero_index == len(grad): + app.error('Unable to find b=0 volume in input DWIs to provide alignment between topup and eddy') + run.command('mrconvert dwi.mif dwi_first_bzero.mif -coord 3 ' + str(dwi_first_bzero_index)) + dwi_first_bzero_pe = dwi_manual_pe_scheme[dwi_first_bzero_index] if overwrite_dwi_pe_scheme else dwi_pe_scheme[dwi_first_bzero_index] + topup_pe_sum = [ 0, 0, 0 ] + topup_volume_to_remove = len(topup_pe_scheme) + for index, line in enumerate(topup_pe_scheme): + topup_pe_sum = [ i + j for i, j in zip(topup_pe_sum, line[0:3]) ] + if line[0:3] == dwi_first_bzero_pe[0:3]: + topup_volume_to_remove = index + if (topup_pe_sum == [ 0, 0, 0 ]) and (topup_volume_to_remove < len(topup_pe_scheme): + app.console('Balanced phase-encoding scheme detected in series provided via -se_epi option; volume ' + str(topup_volume_to_remove) + ' will be removed and replaced with first b=0 from DWIs') + run.command('mrconvert ' + topup_in_path + ' - -coord 3 ' + ','.join([index for index in range(len(topup_pe_scheme)) if not index == topup_volume_to_remove]) + ' | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') + file.delTempFile(topup_in_path) + # Also need to update the phase-encoding scheme appropriately if it's being set manually + # (if embedded within the image headers, should be updated through the command calls) + if topup_manual_pe_scheme: + first_line = list(manual_pe_dir) + first_line.append(trt) + new_topup_manual_pe_scheme = [ ] + new_topup_manual_pe_scheme.append(line) + for index, entry in enumerate(topup_manual_pe_scheme): + if not index == topup_volume_to_remove: + new_topup_manual_pe_scheme.append(entry) + topup_manual_pe_scheme = new_topup_manual_pe_scheme + else + app.console('Unbalanced phase-encoding scheme detected in series provided via -se_epi option; first DWI b=0 volume will be inserted to start of series') + run.command('mrcat dwi_first_bzero.mif ' + topup_in_path + ' topup_in_dwibzero.mif -axis 3') + file.delTempFile(topup_in_path) + # Also need to update the phase-encoding scheme appropriately + if topup_manual_pe_scheme: + first_line = list(manual_pe_dir) + first_line.append(trt) + topup_manual_pe_scheme = [ first_line, topup_manual_pe_scheme ] + topup_in_path = 'topup_in_dwibzero.mif' + + + + + elif not PE_design == 'None': # No SE EPI images explicitly provided: In some cases, can extract appropriate b=0 images from DWI # If using 'All' or 'Header', and haven't been given any topup images, need to extract the b=0 volumes from the series, @@ -404,7 +467,6 @@ if do_topup: # If no axes need to be cropped, use the original topup input volumes # Otherwise, need to call mrcrop with the appropriate options, and pass those to topup - topup_in_path = 'topup_in.mif' # For any non-even axis sizes, crop the first voxel along that dimension # TODO This primarily applies to topup - don't recall if eddy bugs out or not crop_option = '' @@ -413,8 +475,8 @@ if do_topup: crop_option += ' -axis ' + str(axis) + ' 1 ' + str(int(axis_size)-1) if crop_option: app.warn('Topup images contain at least one non-even dimension; cropping images for topup compatibility') - run.command('mrcrop topup_in.mif topup_in_crop.mif' + crop_option) - file.delTempFile('topup_in.mif') + run.command('mrcrop ' + topup_in_path + ' topup_in_crop.mif' + crop_option) + file.delTempFile(topup_in_path) topup_in_path = 'topup_in_crop.mif' # Do the conversion in preparation for topup @@ -565,6 +627,7 @@ else: run.command('mrtransform ' + field_map_image + ' -replace topup_in.nii field_map_fix' + fsl_suffix) file.delTempFile(field_map_image) field_map_image = 'field_map_fix' + fsl_suffix + file.delTempFile('topup_in.nii') From 04fe37584b57abc51c24a00ec1e6220f47f6763b Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 13 Jul 2017 14:11:56 +1000 Subject: [PATCH 026/538] mrinfo: Fix use of std::vector --- cmd/mrinfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/mrinfo.cpp b/cmd/mrinfo.cpp index 5f9b86a797..88bb425f77 100644 --- a/cmd/mrinfo.cpp +++ b/cmd/mrinfo.cpp @@ -14,11 +14,11 @@ #include #include -#include #include "command.h" #include "header.h" #include "phase_encoding.h" +#include "types.h" #include "file/json.h" #include "dwi/gradient.h" @@ -198,7 +198,7 @@ void keyval2json (const Header& header, JSON& json) try { const auto M = parse_matrix (kv.second); for (size_t row = 0; row != M.rows(); ++row) { - std::vector data (M.cols()); + vector data (M.cols()); for (size_t i = 0; i != M.cols(); ++i) data[i] = M (row, i); if (json.find (kv.first) == json.end()) From 2ff779fa210f72ef85cf841ba83801793854efa0 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 14 Jul 2017 15:14:57 +1000 Subject: [PATCH 027/538] dwipreproc: More topup / eddy alignment work - Check to see if both hears contain an echo time key-value, and give a warning if they differ (e.g. if one were to use a shorter TE for acquiring spin-echo EPI images just for estimating the inhomogeneity field, the technique employed here would no longer work, since topup would be estimating squared errors between those volumes and a b=0 volume from the DWIs). - If the DWIs and spin-echo EPI images are not defined on the same voxel grid, issue a warning, and re-sample the spin-echo EPI images onto the grid of the DWIs; this is necessary to enable concatenation of the first b=0 DWI volume at the start of the topup input. --- bin/dwipreproc | 50 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 1bc36a81b7..7f2cbe3e9c 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -363,19 +363,11 @@ if app.args.se_epi: app.error('No phase-encoding information present in SE EPI image header'); # If we are using the -se_epi option, and hence the input images to topup have not come from the DWIs themselves, - # we need to insert the first b=0 DWI volume to the start of the topup input image - # Additionally: - # - If the input to topup is currently balanced in terms of phase encoding, and insertion of this volume is therefore - # unbalancing the input, and we can find an existing volume in the SE_EPI image with the same phase encoding as the - # first DWI, remove that volume from the input to topup - # - TODO If the DWI is defined on a different voxel grid to the SE-EPI image, it will be necessary to re-grid the SE-EPI - # data to match the DWI - # - Ideally, it would also be preferable to somehow quantify the overall image contrast between the b=0 image, and the SE-EPI - # images, and instead use a registration-based solution. However I think this can wait for now, given I don't know of - # anybody using such an acquisition. - # - TODO The first b=0 volume in the DWIs should also be the first volume of the DWI series; is basically always the case, but + # we need to insert the first b=0 DWI volume to the start of the topup input image. Otherwise, the field estimated + # by topup will not be correctly aligned with the volumes as they are processed by eddy. + # TODO Yet to do: + # - The first b=0 volume in the DWIs should also be the first volume of the DWI series; is basically always the case, but # it wouuld nevertheless be preferable to test for this - bzero_threshold = 10.0 if ['BZeroThreshold'] in app.config: bzero_threshold = float(app.config['BZeroThreshold']) @@ -386,17 +378,38 @@ if app.args.se_epi: dwi_first_bzero_index += 1 if dwi_first_bzero_index == len(grad): app.error('Unable to find b=0 volume in input DWIs to provide alignment between topup and eddy') - run.command('mrconvert dwi.mif dwi_first_bzero.mif -coord 3 ' + str(dwi_first_bzero_index)) + run.command('mrconvert dwi.mif dwi_first_bzero.mif -coord 3 ' + str(dwi_first_bzero_index) + ' -axes 0,1,2') dwi_first_bzero_pe = dwi_manual_pe_scheme[dwi_first_bzero_index] if overwrite_dwi_pe_scheme else dwi_pe_scheme[dwi_first_bzero_index] + + dwi_te = image.headerKeyValue('dwi.mif', 'EchoTime') + fmap_te = image.headerKeyValue(topup_in_path, 'EchoTime') + if dwi_te and fmap_te and not dwi_te == fmap_te: + app.warn('It appears that the spin-echo EPI images used for inhomogeneity field estimation have a different echo time to the DWIs being corrected. ' + 'This may cause issues in estimation of the field, as the first DWI b=0 volume must be additionally used as input to topup for alignment purposes. ' + 'SE-EPI images with different contrast to the DWI b=0 images is not yet supported by dwipreproc.') + + # Since image.match() is very basic, and won't accept an image pair with different numbers of volumes, + # need to get just the first volume of each in order to test + run.command('mrconvert ' + topup_in_path + ' first_fmap_volume.mif -coord 3 0 -axes 0,1,2') + fmap_needs_regrid = not image.match('dwi_first_bzero.mif', 'first_fmap_volume.mif') + file.delTempFile('first_fmap_volume.mif') + if fmap_needs_regrid: + app.warn('DWIs and SE-EPI images used for inhomogeneity field estimation are defined on different image grids; ' + 'The latter will be autmoatically re-gridded to match the former to facilitate spatial alignment ' + 'between topup and eddy stages') + topup_pe_sum = [ 0, 0, 0 ] topup_volume_to_remove = len(topup_pe_scheme) for index, line in enumerate(topup_pe_scheme): topup_pe_sum = [ i + j for i, j in zip(topup_pe_sum, line[0:3]) ] if line[0:3] == dwi_first_bzero_pe[0:3]: topup_volume_to_remove = index - if (topup_pe_sum == [ 0, 0, 0 ]) and (topup_volume_to_remove < len(topup_pe_scheme): - app.console('Balanced phase-encoding scheme detected in series provided via -se_epi option; volume ' + str(topup_volume_to_remove) + ' will be removed and replaced with first b=0 from DWIs') - run.command('mrconvert ' + topup_in_path + ' - -coord 3 ' + ','.join([index for index in range(len(topup_pe_scheme)) if not index == topup_volume_to_remove]) + ' | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') + if (topup_pe_sum == [ 0, 0, 0 ]) and (topup_volume_to_remove < len(topup_pe_scheme)): + app.console('Balanced phase-encoding scheme detected in \'' + app.args.se_epi + '\'; volume ' + str(topup_volume_to_remove) + ' will be removed and replaced with first b=0 from DWIs') + if fmap_needs_regrid: + run.command('mrconvert ' + topup_in_path + ' - -coord 3 ' + ','.join([index for index in range(len(topup_pe_scheme)) if not index == topup_volume_to_remove]) + ' | mrtransform - - -interp sinc -template dwi_first_bzero.mif | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') + else: + run.command('mrconvert ' + topup_in_path + ' - -coord 3 ' + ','.join([index for index in range(len(topup_pe_scheme)) if not index == topup_volume_to_remove]) + ' | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') file.delTempFile(topup_in_path) # Also need to update the phase-encoding scheme appropriately if it's being set manually # (if embedded within the image headers, should be updated through the command calls) @@ -411,7 +424,10 @@ if app.args.se_epi: topup_manual_pe_scheme = new_topup_manual_pe_scheme else app.console('Unbalanced phase-encoding scheme detected in series provided via -se_epi option; first DWI b=0 volume will be inserted to start of series') - run.command('mrcat dwi_first_bzero.mif ' + topup_in_path + ' topup_in_dwibzero.mif -axis 3') + if fmap_needs_regrid: + run.command('mrtransform ' + topup_in_path + ' - -interp sinc -template dwi_first_bzero.mif | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') + else: + run.command('mrcat dwi_first_bzero.mif ' + topup_in_path + ' topup_in_dwibzero.mif -axis 3') file.delTempFile(topup_in_path) # Also need to update the phase-encoding scheme appropriately if topup_manual_pe_scheme: From 79cbc104cc17c7c0e523dd01daadaa11aec8cbbb Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 14 Jul 2017 16:37:17 +1000 Subject: [PATCH 028/538] dwipreproc: Fixes and tweaks for eddy / topup alignment --- bin/dwipreproc | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 7f2cbe3e9c..b0e1e257f7 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -369,7 +369,7 @@ if app.args.se_epi: # - The first b=0 volume in the DWIs should also be the first volume of the DWI series; is basically always the case, but # it wouuld nevertheless be preferable to test for this bzero_threshold = 10.0 - if ['BZeroThreshold'] in app.config: + if 'BZeroThreshold' in app.config: bzero_threshold = float(app.config['BZeroThreshold']) dwi_first_bzero_index = 0 for line in grad: @@ -388,28 +388,28 @@ if app.args.se_epi: 'This may cause issues in estimation of the field, as the first DWI b=0 volume must be additionally used as input to topup for alignment purposes. ' 'SE-EPI images with different contrast to the DWI b=0 images is not yet supported by dwipreproc.') - # Since image.match() is very basic, and won't accept an image pair with different numbers of volumes, - # need to get just the first volume of each in order to test - run.command('mrconvert ' + topup_in_path + ' first_fmap_volume.mif -coord 3 0 -axes 0,1,2') - fmap_needs_regrid = not image.match('dwi_first_bzero.mif', 'first_fmap_volume.mif') - file.delTempFile('first_fmap_volume.mif') + # Don't need to use image.match() here; only require that the dimensions of the first three axes, and + # the first three voxel sizes, to be equivalent + dwi_vox = [ float(f) for f in image.headerField('dwi.mif', 'vox').strip().split() ] + topup_vox = [ float(f) for f in image.headerField(topup_in_path, 'vox').strip().split() ] + fmap_needs_regrid = not (dwi_size[0:3] == topup_size[0:3] and dwi_vox[0:3] == topup_vox[0:3]) if fmap_needs_regrid: app.warn('DWIs and SE-EPI images used for inhomogeneity field estimation are defined on different image grids; ' - 'The latter will be autmoatically re-gridded to match the former to facilitate spatial alignment ' + 'The latter will be automatically re-gridded to match the former to facilitate spatial alignment ' 'between topup and eddy stages') topup_pe_sum = [ 0, 0, 0 ] topup_volume_to_remove = len(topup_pe_scheme) for index, line in enumerate(topup_pe_scheme): topup_pe_sum = [ i + j for i, j in zip(topup_pe_sum, line[0:3]) ] - if line[0:3] == dwi_first_bzero_pe[0:3]: + if topup_volume_to_remove == len(topup_pe_scheme) and line[0:3] == dwi_first_bzero_pe[0:3]: topup_volume_to_remove = index if (topup_pe_sum == [ 0, 0, 0 ]) and (topup_volume_to_remove < len(topup_pe_scheme)): app.console('Balanced phase-encoding scheme detected in \'' + app.args.se_epi + '\'; volume ' + str(topup_volume_to_remove) + ' will be removed and replaced with first b=0 from DWIs') if fmap_needs_regrid: - run.command('mrconvert ' + topup_in_path + ' - -coord 3 ' + ','.join([index for index in range(len(topup_pe_scheme)) if not index == topup_volume_to_remove]) + ' | mrtransform - - -interp sinc -template dwi_first_bzero.mif | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') + run.command('mrconvert ' + topup_in_path + ' - -coord 3 ' + ','.join([str(index) for index in range(len(topup_pe_scheme)) if not index == topup_volume_to_remove]) + ' | mrtransform - - -interp sinc -template dwi_first_bzero.mif | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') else: - run.command('mrconvert ' + topup_in_path + ' - -coord 3 ' + ','.join([index for index in range(len(topup_pe_scheme)) if not index == topup_volume_to_remove]) + ' | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') + run.command('mrconvert ' + topup_in_path + ' - -coord 3 ' + ','.join([str(index) for index in range(len(topup_pe_scheme)) if not index == topup_volume_to_remove]) + ' | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') file.delTempFile(topup_in_path) # Also need to update the phase-encoding scheme appropriately if it's being set manually # (if embedded within the image headers, should be updated through the command calls) @@ -422,8 +422,11 @@ if app.args.se_epi: if not index == topup_volume_to_remove: new_topup_manual_pe_scheme.append(entry) topup_manual_pe_scheme = new_topup_manual_pe_scheme - else - app.console('Unbalanced phase-encoding scheme detected in series provided via -se_epi option; first DWI b=0 volume will be inserted to start of series') + else: + if topup_pe_sum == [ 0, 0, 0 ] and topup_volume_to_remove == len(topup_pe_scheme): + app.console('Phase-encoding scheme of -se_epi image is balanced, but could not find appropriate volume with which to substitute first b=0 volume from DWIs; first b=0 DWI volume will be inserted to start of series') + else: + app.console('Unbalanced phase-encoding scheme detected in series provided via -se_epi option; first DWI b=0 volume will be inserted to start of series') if fmap_needs_regrid: run.command('mrtransform ' + topup_in_path + ' - -interp sinc -template dwi_first_bzero.mif | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') else: @@ -435,10 +438,10 @@ if app.args.se_epi: first_line.append(trt) topup_manual_pe_scheme = [ first_line, topup_manual_pe_scheme ] topup_in_path = 'topup_in_dwibzero.mif' - - - - + + + + elif not PE_design == 'None': # No SE EPI images explicitly provided: In some cases, can extract appropriate b=0 images from DWI From f632bfff0b2fd572c0f62e9c8a534905c1452ead Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 18 Jul 2017 13:44:36 +1000 Subject: [PATCH 029/538] dwipreproc: Handle first b=0 volume != first volume --- bin/dwipreproc | 169 +++++++++++++++++++++++++++++-------------------- 1 file changed, 102 insertions(+), 67 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index b0e1e257f7..fb09679c2b 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -310,6 +310,8 @@ if overwrite_dwi_pe_scheme: # Deal with the phase-encoding of the images to be fed to topup (if applicable) overwrite_topup_pe_scheme = False topup_in_path = 'topup_in.mif' +dwi_permute_volumes_pre_eddy_option = '' +dwi_permute_volumes_post_eddy_option = '' if app.args.se_epi: # 3 possible sources of PE information: DWI header, topup image header, command-line @@ -377,70 +379,93 @@ if app.args.se_epi: break dwi_first_bzero_index += 1 if dwi_first_bzero_index == len(grad): - app.error('Unable to find b=0 volume in input DWIs to provide alignment between topup and eddy') - run.command('mrconvert dwi.mif dwi_first_bzero.mif -coord 3 ' + str(dwi_first_bzero_index) + ' -axes 0,1,2') - dwi_first_bzero_pe = dwi_manual_pe_scheme[dwi_first_bzero_index] if overwrite_dwi_pe_scheme else dwi_pe_scheme[dwi_first_bzero_index] - - dwi_te = image.headerKeyValue('dwi.mif', 'EchoTime') - fmap_te = image.headerKeyValue(topup_in_path, 'EchoTime') - if dwi_te and fmap_te and not dwi_te == fmap_te: - app.warn('It appears that the spin-echo EPI images used for inhomogeneity field estimation have a different echo time to the DWIs being corrected. ' - 'This may cause issues in estimation of the field, as the first DWI b=0 volume must be additionally used as input to topup for alignment purposes. ' - 'SE-EPI images with different contrast to the DWI b=0 images is not yet supported by dwipreproc.') - - # Don't need to use image.match() here; only require that the dimensions of the first three axes, and - # the first three voxel sizes, to be equivalent - dwi_vox = [ float(f) for f in image.headerField('dwi.mif', 'vox').strip().split() ] - topup_vox = [ float(f) for f in image.headerField(topup_in_path, 'vox').strip().split() ] - fmap_needs_regrid = not (dwi_size[0:3] == topup_size[0:3] and dwi_vox[0:3] == topup_vox[0:3]) - if fmap_needs_regrid: - app.warn('DWIs and SE-EPI images used for inhomogeneity field estimation are defined on different image grids; ' - 'The latter will be automatically re-gridded to match the former to facilitate spatial alignment ' - 'between topup and eddy stages') - - topup_pe_sum = [ 0, 0, 0 ] - topup_volume_to_remove = len(topup_pe_scheme) - for index, line in enumerate(topup_pe_scheme): - topup_pe_sum = [ i + j for i, j in zip(topup_pe_sum, line[0:3]) ] - if topup_volume_to_remove == len(topup_pe_scheme) and line[0:3] == dwi_first_bzero_pe[0:3]: - topup_volume_to_remove = index - if (topup_pe_sum == [ 0, 0, 0 ]) and (topup_volume_to_remove < len(topup_pe_scheme)): - app.console('Balanced phase-encoding scheme detected in \'' + app.args.se_epi + '\'; volume ' + str(topup_volume_to_remove) + ' will be removed and replaced with first b=0 from DWIs') - if fmap_needs_regrid: - run.command('mrconvert ' + topup_in_path + ' - -coord 3 ' + ','.join([str(index) for index in range(len(topup_pe_scheme)) if not index == topup_volume_to_remove]) + ' | mrtransform - - -interp sinc -template dwi_first_bzero.mif | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') - else: - run.command('mrconvert ' + topup_in_path + ' - -coord 3 ' + ','.join([str(index) for index in range(len(topup_pe_scheme)) if not index == topup_volume_to_remove]) + ' | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') - file.delTempFile(topup_in_path) - # Also need to update the phase-encoding scheme appropriately if it's being set manually - # (if embedded within the image headers, should be updated through the command calls) - if topup_manual_pe_scheme: - first_line = list(manual_pe_dir) - first_line.append(trt) - new_topup_manual_pe_scheme = [ ] - new_topup_manual_pe_scheme.append(line) - for index, entry in enumerate(topup_manual_pe_scheme): - if not index == topup_volume_to_remove: - new_topup_manual_pe_scheme.append(entry) - topup_manual_pe_scheme = new_topup_manual_pe_scheme + # TODO Need to test whether different grids between SE-EPI and DWI will crash eddy in this scenario + app.warn('Unable to find b=0 volume in input DWIs to provide alignment between topup and eddy; script will proceed on the assumption that motion between the SE-EPI and DWI series is negligible') else: - if topup_pe_sum == [ 0, 0, 0 ] and topup_volume_to_remove == len(topup_pe_scheme): - app.console('Phase-encoding scheme of -se_epi image is balanced, but could not find appropriate volume with which to substitute first b=0 volume from DWIs; first b=0 DWI volume will be inserted to start of series') - else: - app.console('Unbalanced phase-encoding scheme detected in series provided via -se_epi option; first DWI b=0 volume will be inserted to start of series') + run.command('mrconvert dwi.mif dwi_first_bzero.mif -coord 3 ' + str(dwi_first_bzero_index) + ' -axes 0,1,2') + dwi_first_bzero_pe = dwi_manual_pe_scheme[dwi_first_bzero_index] if overwrite_dwi_pe_scheme else dwi_pe_scheme[dwi_first_bzero_index] + + dwi_te = image.headerKeyValue('dwi.mif', 'EchoTime') + fmap_te = image.headerKeyValue(topup_in_path, 'EchoTime') + if dwi_te and fmap_te and not dwi_te == fmap_te: + app.warn('It appears that the spin-echo EPI images used for inhomogeneity field estimation have a different echo time to the DWIs being corrected. ' + 'This may cause issues in estimation of the field, as the first DWI b=0 volume must be additionally used as input to topup for alignment purposes. ' + 'SE-EPI images with different contrast to the DWI b=0 images is not yet supported by dwipreproc.') + + # Don't need to use image.match() here; only require that the dimensions of the first three axes, and + # the first three voxel sizes, to be equivalent + dwi_vox = [ float(f) for f in image.headerField('dwi.mif', 'vox').strip().split() ] + topup_vox = [ float(f) for f in image.headerField(topup_in_path, 'vox').strip().split() ] + fmap_needs_regrid = not (dwi_size[0:3] == topup_size[0:3] and dwi_vox[0:3] == topup_vox[0:3]) if fmap_needs_regrid: - run.command('mrtransform ' + topup_in_path + ' - -interp sinc -template dwi_first_bzero.mif | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') + app.warn('DWIs and SE-EPI images used for inhomogeneity field estimation are defined on different image grids; ' + 'The latter will be automatically re-gridded to match the former to facilitate spatial alignment ' + 'between topup and eddy stages') + + topup_pe_sum = [ 0, 0, 0 ] + topup_volume_to_remove = len(topup_pe_scheme) + for index, line in enumerate(topup_pe_scheme): + topup_pe_sum = [ i + j for i, j in zip(topup_pe_sum, line[0:3]) ] + if topup_volume_to_remove == len(topup_pe_scheme) and line[0:3] == dwi_first_bzero_pe[0:3]: + topup_volume_to_remove = index + if (topup_pe_sum == [ 0, 0, 0 ]) and (topup_volume_to_remove < len(topup_pe_scheme)): + app.console('Balanced phase-encoding scheme detected in \'' + app.args.se_epi + '\'; volume ' + str(topup_volume_to_remove) + ' will be removed and replaced with first b=0 from DWIs') + if fmap_needs_regrid: + run.command('mrconvert ' + topup_in_path + ' - -coord 3 ' + ','.join([str(index) for index in range(len(topup_pe_scheme)) if not index == topup_volume_to_remove]) + ' | mrtransform - - -interp sinc -template dwi_first_bzero.mif | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') + else: + run.command('mrconvert ' + topup_in_path + ' - -coord 3 ' + ','.join([str(index) for index in range(len(topup_pe_scheme)) if not index == topup_volume_to_remove]) + ' | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') + file.delTempFile(topup_in_path) + # Also need to update the phase-encoding scheme appropriately if it's being set manually + # (if embedded within the image headers, should be updated through the command calls) + if topup_manual_pe_scheme: + first_line = list(manual_pe_dir) + first_line.append(trt) + new_topup_manual_pe_scheme = [ ] + new_topup_manual_pe_scheme.append(line) + for index, entry in enumerate(topup_manual_pe_scheme): + if not index == topup_volume_to_remove: + new_topup_manual_pe_scheme.append(entry) + topup_manual_pe_scheme = new_topup_manual_pe_scheme else: - run.command('mrcat dwi_first_bzero.mif ' + topup_in_path + ' topup_in_dwibzero.mif -axis 3') - file.delTempFile(topup_in_path) - # Also need to update the phase-encoding scheme appropriately - if topup_manual_pe_scheme: - first_line = list(manual_pe_dir) - first_line.append(trt) - topup_manual_pe_scheme = [ first_line, topup_manual_pe_scheme ] - topup_in_path = 'topup_in_dwibzero.mif' - - - + if topup_pe_sum == [ 0, 0, 0 ] and topup_volume_to_remove == len(topup_pe_scheme): + app.console('Phase-encoding scheme of -se_epi image is balanced, but could not find appropriate volume with which to substitute first b=0 volume from DWIs; first b=0 DWI volume will be inserted to start of series') + else: + app.console('Unbalanced phase-encoding scheme detected in series provided via -se_epi option; first DWI b=0 volume will be inserted to start of series') + if fmap_needs_regrid: + run.command('mrtransform ' + topup_in_path + ' - -interp sinc -template dwi_first_bzero.mif | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') + else: + run.command('mrcat dwi_first_bzero.mif ' + topup_in_path + ' topup_in_dwibzero.mif -axis 3') + file.delTempFile(topup_in_path) + # Also need to update the phase-encoding scheme appropriately + if topup_manual_pe_scheme: + first_line = list(manual_pe_dir) + first_line.append(trt) + topup_manual_pe_scheme = [ first_line, topup_manual_pe_scheme ] + + # Ended branching based on balanced-ness of PE acquisition scheme within SE-EPI volumes + topup_in_path = 'topup_in_dwibzero.mif' + + # If the first b=0 volume in the DWIs is in fact not the volume (i.e. index zero), we're going to + # manually place it at the start of the DWI volumes when they are input to eddy, so that the + # first input volume to topup and the first input volume to eddy are one and the same. + # Note: If at a later date, the statistical outputs from eddy are considered (e.g. motion, outliers), + # then this volume permutation will need to be taken into account + if dwi_first_bzero_index: + app.console('First b=0 volume in input DWIs is volume ' + str(dwi_first_bzero_index) + ' of ' + str(num_volumes) + '; ' + 'this will be permuted to be the first volume when eddy is run') + dwi_permute_volumes_pre_eddy_option = ' -coord 3 ' + + str(dwi_first_bzero_index) + + ',0' + + (':' + str(dwi_first_bzero_index-1) if dwi_first_bero_index > 1) + + (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < num_volumes-1) + + (':' + str(num_volumes-1) if dwi_first_bzero_index < num_volumes-2) + dwi_permute_volumes_post_eddy_option = ' -coord 3 1' + + (':' + str(dwi_first_bzero_index) if dwi_first_bzero_index > 1) + + ',0' + + (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < num_volumes-1) + + (':' + str(num_volumes-1) if dwi_first_bzero_index < num_volumes-2) + + # Completed checking for presence of b=0 image in DWIs elif not PE_design == 'None': # No SE EPI images explicitly provided: In some cases, can extract appropriate b=0 images from DWI @@ -543,7 +568,7 @@ else: # Run eddy -run.command('mrconvert dwi.mif' + import_dwi_pe_table_option + ' dwi.nii -stride -1,+2,+3,+4 -export_grad_fsl bvecs bvals -export_pe_eddy eddy_config.txt eddy_indices.txt') +run.command('mrconvert dwi.mif' + import_dwi_pe_table_option + dwi_permute_volumes_pre_eddy_option + ' dwi.nii -stride -1,+2,+3,+4 -export_grad_fsl bvecs bvals -export_pe_eddy eddy_config.txt eddy_indices.txt') file.delTempFile('dwi.mif') eddy_manual_options = '' if app.args.eddy_options: @@ -587,7 +612,7 @@ for index1 in range(num_volumes): if not len(volume_pairs) == num_volumes/2: # Convert the resulting volume to the output image, and re-insert the diffusion encoding - run.command('mrconvert dwi_post_eddy' + fsl_suffix + ' result.mif' + stride_option + ' -fslgrad ' + bvecs_path + ' bvals') + run.command('mrconvert dwi_post_eddy' + fsl_suffix + ' result.mif' + dwi_permute_volumes_post_eddy_option + stride_option + ' -fslgrad ' + bvecs_path + ' bvals') else: app.console('Detected matching DWI volumes with opposing phase encoding; performing explicit volume recombination') @@ -676,27 +701,37 @@ else: run.command('mrcalc ' + jacobian_path + ' ' + jacobian_path + ' -mult weight' + str(index+1) + '.mif') file.delTempFile(jacobian_path) + # If the DWI volumes were permuted prior to running eddy, then the simplest approach is to permute them + # back to their original positions; otherwise, the stored gradient vector directions / phase encode + # directions / matched volume pairs are no longer appropriate + volume_recombination_input = 'dwi_post_eddy' + fsl_suffix + if dwi_permute_volumes_post_eddy_option: + run.command('mrconvert ' + volume_recombination_input + dwi_permute_volumes_post_eddy_option + 'dwi_post_eddy.mif') + file.delTempFile(volume_recombination_input) + volume_recombination_input = 'dwi_post_eddy.mif' + # This section extracts the two volumes corresponding to each reversed phase-encoded volume pair, and # derives a single image volume based on the recombination equation combined_image_list = [ ] for index, volumes in enumerate(volume_pairs): pe_indices = [ eddy_indices[i] for i in volumes ] - run.command('mrconvert dwi_post_eddy' + fsl_suffix + ' volume0.mif -coord 3 ' + str(volumes[0])) - run.command('mrconvert dwi_post_eddy' + fsl_suffix + ' volume1.mif -coord 3 ' + str(volumes[1])) + run.command('mrconvert ' + volume_recombination_input + ' volume0.mif -coord 3 ' + str(volumes[0])) + run.command('mrconvert ' + volume_recombination_input + ' volume1.mif -coord 3 ' + str(volumes[1])) # Volume recombination equation described in Skare and Bammer 2010 run.command('mrcalc volume0.mif weight' + str(pe_indices[0]) + '.mif -mult volume1.mif weight' + str(pe_indices[1]) + '.mif -mult -add weight' + str(pe_indices[0]) + '.mif weight' + str(pe_indices[1]) + '.mif -add -divide 0.0 -max combined' + str(index) + '.mif') combined_image_list.append('combined' + str(index) + '.mif') file.delTempFile('volume0.mif') file.delTempFile('volume1.mif') + file.delTempFile(volume_recombination_input) for index in range(0, len(eddy_config)): file.delTempFile('weight' + str(index+1) + '.mif') # Finally the recombined volumes must be concatenated to produce the resulting image series run.command('mrcat ' + ' '.join(combined_image_list) + ' - -axis 3 | mrconvert - result.mif -fslgrad bvecs_combined bvals_combined' + stride_option) - for path in combined_image_list: - file.delTempFile(path) + for entry in combined_image_list: + file.delTempFile(entry) From 656e230f2d1b8fbb55a4a4541b7260de4f1c5793 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 18 Jul 2017 15:09:53 +1000 Subject: [PATCH 030/538] dwipreproc: Fixes for first-volume b=0 enforcement --- bin/dwipreproc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index fb09679c2b..6fde3462c7 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -299,7 +299,7 @@ else: # This may be required by -rpe_all for extracting b=0 volumes while retaining phase-encoding information import_dwi_pe_table_option = '' -if overwrite_dwi_pe_scheme: +if dwi_manual_pe_scheme: with open('dwi_manual_pe_scheme.txt', 'w') as f: for line in dwi_manual_pe_scheme: f.write(' '.join( [ str(value) for value in line ] ) + '\n') @@ -453,16 +453,16 @@ if app.args.se_epi: if dwi_first_bzero_index: app.console('First b=0 volume in input DWIs is volume ' + str(dwi_first_bzero_index) + ' of ' + str(num_volumes) + '; ' 'this will be permuted to be the first volume when eddy is run') - dwi_permute_volumes_pre_eddy_option = ' -coord 3 ' + - str(dwi_first_bzero_index) + - ',0' + - (':' + str(dwi_first_bzero_index-1) if dwi_first_bero_index > 1) + - (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < num_volumes-1) + + dwi_permute_volumes_pre_eddy_option = ' -coord 3 ' + \ + str(dwi_first_bzero_index) + \ + ',0' + \ + (':' + str(dwi_first_bzero_index-1) if dwi_first_bzero_index > 1) + \ + (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < num_volumes-1) + \ (':' + str(num_volumes-1) if dwi_first_bzero_index < num_volumes-2) - dwi_permute_volumes_post_eddy_option = ' -coord 3 1' + - (':' + str(dwi_first_bzero_index) if dwi_first_bzero_index > 1) + - ',0' + - (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < num_volumes-1) + + dwi_permute_volumes_post_eddy_option = ' -coord 3 1' + \ + (':' + str(dwi_first_bzero_index) if dwi_first_bzero_index > 1) + \ + ',0' + \ + (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < num_volumes-1) + \ (':' + str(num_volumes-1) if dwi_first_bzero_index < num_volumes-2) # Completed checking for presence of b=0 image in DWIs From 4bb3f6ff02cf5e8c61807e91b6e8b60e758ceb5e Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 18 Jul 2017 17:09:34 +1000 Subject: [PATCH 031/538] dwipreproc: Final fixes to b=0 first volume enforcement --- bin/dwipreproc | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 6fde3462c7..b315352689 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -367,9 +367,6 @@ if app.args.se_epi: # If we are using the -se_epi option, and hence the input images to topup have not come from the DWIs themselves, # we need to insert the first b=0 DWI volume to the start of the topup input image. Otherwise, the field estimated # by topup will not be correctly aligned with the volumes as they are processed by eddy. - # TODO Yet to do: - # - The first b=0 volume in the DWIs should also be the first volume of the DWI series; is basically always the case, but - # it wouuld nevertheless be preferable to test for this bzero_threshold = 10.0 if 'BZeroThreshold' in app.config: bzero_threshold = float(app.config['BZeroThreshold']) @@ -421,7 +418,7 @@ if app.args.se_epi: first_line = list(manual_pe_dir) first_line.append(trt) new_topup_manual_pe_scheme = [ ] - new_topup_manual_pe_scheme.append(line) + new_topup_manual_pe_scheme.append(first_line) for index, entry in enumerate(topup_manual_pe_scheme): if not index == topup_volume_to_remove: new_topup_manual_pe_scheme.append(entry) @@ -451,19 +448,19 @@ if app.args.se_epi: # Note: If at a later date, the statistical outputs from eddy are considered (e.g. motion, outliers), # then this volume permutation will need to be taken into account if dwi_first_bzero_index: - app.console('First b=0 volume in input DWIs is volume ' + str(dwi_first_bzero_index) + ' of ' + str(num_volumes) + '; ' - 'this will be permuted to be the first volume when eddy is run') + app.console('First b=0 volume in input DWIs is volume index ' + str(dwi_first_bzero_index) + '; ' + 'this will be permuted to be the first volume (index 0) when eddy is run') dwi_permute_volumes_pre_eddy_option = ' -coord 3 ' + \ str(dwi_first_bzero_index) + \ ',0' + \ - (':' + str(dwi_first_bzero_index-1) if dwi_first_bzero_index > 1) + \ - (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < num_volumes-1) + \ - (':' + str(num_volumes-1) if dwi_first_bzero_index < num_volumes-2) + (':' + str(dwi_first_bzero_index-1) if dwi_first_bzero_index > 1 else '') + \ + (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < num_volumes-1 else '') + \ + (':' + str(num_volumes-1) if dwi_first_bzero_index < num_volumes-2 else '') dwi_permute_volumes_post_eddy_option = ' -coord 3 1' + \ - (':' + str(dwi_first_bzero_index) if dwi_first_bzero_index > 1) + \ + (':' + str(dwi_first_bzero_index) if dwi_first_bzero_index > 1 else '') + \ ',0' + \ - (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < num_volumes-1) + \ - (':' + str(num_volumes-1) if dwi_first_bzero_index < num_volumes-2) + (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < num_volumes-1 else '') + \ + (':' + str(num_volumes-1) if dwi_first_bzero_index < num_volumes-2 else '') # Completed checking for presence of b=0 image in DWIs From 7eb4cb4f1619453de4c6fe0534f78806a42215d3 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 18 Jul 2017 17:34:25 +1000 Subject: [PATCH 032/538] dwipreproc: Revise message for no b=0 volumes in DWI --- bin/dwipreproc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index b315352689..5d9174f9cc 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -376,8 +376,7 @@ if app.args.se_epi: break dwi_first_bzero_index += 1 if dwi_first_bzero_index == len(grad): - # TODO Need to test whether different grids between SE-EPI and DWI will crash eddy in this scenario - app.warn('Unable to find b=0 volume in input DWIs to provide alignment between topup and eddy; script will proceed on the assumption that motion between the SE-EPI and DWI series is negligible') + app.warn('Unable to find b=0 volume in input DWIs to provide alignment between topup and eddy; script will proceed on the assumption that motion between the SE-EPI and DWI series is negligible. Note however that eddy itself may crash in this scenario.') else: run.command('mrconvert dwi.mif dwi_first_bzero.mif -coord 3 ' + str(dwi_first_bzero_index) + ' -axes 0,1,2') dwi_first_bzero_pe = dwi_manual_pe_scheme[dwi_first_bzero_index] if overwrite_dwi_pe_scheme else dwi_pe_scheme[dwi_first_bzero_index] From 2e30340b947ae834c024d2002cbfd4eea6b57f1f Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 21 Jul 2017 13:26:00 +1000 Subject: [PATCH 033/538] 5ttgen fsl: Deal with T1 resolution If the script detects that the spatial resolution of the input T1 image is relatively poor, it will do two things: - Warn the user at the start of the script that the resolution is poor, and that down-sampling of the T1 image to match the DWIs is unnecessary. - Generate an upsampled version of the T1 to feed to FIRST, in the hope that that script will no longer encounter an issue with converting a surface mesh representation into a 3D volume. --- lib/mrtrix3/_5ttgen/fsl.py | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/lib/mrtrix3/_5ttgen/fsl.py b/lib/mrtrix3/_5ttgen/fsl.py index 61a86239bf..65f46e854a 100644 --- a/lib/mrtrix3/_5ttgen/fsl.py +++ b/lib/mrtrix3/_5ttgen/fsl.py @@ -83,6 +83,14 @@ def execute(): if app.args.sgm_amyg_hipp: sgm_structures.extend([ 'L_Amyg', 'R_Amyg', 'L_Hipp', 'R_Hipp' ]) + t1_dim = [ float(f) for f in image.headerField('input.mif', 'vox').strip().split() ] + upsample_for_first = False + if max(t1_dim) > 1.05: #Allow e.g. 1.01mm voxels, if FoV and matrix size are not perfectly equivalent + app.warn('Voxel size larger than 1.0mm detected (' + str(t1_dim) + '); ' + 'note that ACT does not require re-gridding of T1 image to DWI space, and indeed ' + 'retaining the original higher resolution of the T1 image is preferable') + upsample_for_first = True + run.command('mrconvert input.mif T1.nii -stride -1,+2,+3') fast_t1_input = 'T1.nii' @@ -99,8 +107,8 @@ def execute(): mask_path = 'mask.mif' else: app.warn('Mask image does not match input image - re-gridding') - run.command('mrtransform mask.mif mask_regrid.mif -template T1.nii') - run.command('mrcalc T1.nii mask_regrid.mif ' + fast_t1_input) + run.command('mrtransform mask.mif mask_regrid.mif -template T1.nii -datatype bit') + run.command('mrcalc T1.nii mask_regrid.mif -mult ' + fast_t1_input) mask_path = 'mask_regrid.mif' if os.path.exists('T2.nii'): @@ -162,10 +170,15 @@ def execute(): fast_output_prefix = fast_t1_input.split('.')[0] # FIRST - first_input_is_brain_extracted = '' + first_input = 'T1.nii' + if upsample_for_first: + app.warn('Generating 1mm isotropic T1 image for FIRST in hope of preventing failure, since input image is of lower resolution') + run.command('mrresize T1.nii T1_1mm.nii -voxel 1.0 -interp sinc') + first_input = 'T1_1mm.nii' + first_input_brain_extracted_option = '' if app.args.premasked: - first_input_is_brain_extracted = ' -b' - run.command(first_cmd + ' -s ' + ','.join(sgm_structures) + ' -i T1.nii -o first' + first_input_is_brain_extracted) + first_input_brain_extracted_option = ' -b' + run.command(first_cmd + ' -s ' + ','.join(sgm_structures) + ' -i ' + first_input + ' -o first' + first_input_brain_extracted_option) # Test to see whether or not FIRST has succeeded # However if the expected image is absent, it may be due to FIRST being run @@ -186,7 +199,7 @@ def execute(): pve_image_path = 'mesh2pve_' + struct + '.mif' vtk_in_path = 'first-' + struct + '_first.vtk' vtk_temp_path = struct + '.vtk' - run.command('meshconvert ' + vtk_in_path + ' ' + vtk_temp_path + ' -transform first2real T1.nii') + run.command('meshconvert ' + vtk_in_path + ' ' + vtk_temp_path + ' -transform first2real ' + first_input) run.command('mesh2pve ' + vtk_temp_path + ' ' + fast_t1_input + ' ' + pve_image_path) pve_image_list.append(pve_image_path) pve_cat = ' '.join(pve_image_list) From 5ea41599087c3176427175b66f0abe7873e9aea8 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 21 Jul 2017 14:06:14 +1000 Subject: [PATCH 034/538] mrconvert: More verbose help page --- cmd/mrconvert.cpp | 101 +++++++++++++++++++------- docs/reference/commands/mrconvert.rst | 29 ++++++-- 2 files changed, 97 insertions(+), 33 deletions(-) diff --git a/cmd/mrconvert.cpp b/cmd/mrconvert.cpp index 48154a6c12..233c13a2cd 100644 --- a/cmd/mrconvert.cpp +++ b/cmd/mrconvert.cpp @@ -17,6 +17,7 @@ #include "image.h" #include "phase_encoding.h" #include "transform.h" +#include "types.h" #include "algo/threaded_copy.h" #include "adapter/extract.h" #include "adapter/permute_axes.h" @@ -39,44 +40,90 @@ void usage () + "If used correctly, this program can be a very useful workhorse. " "In addition to converting images between different formats, it can " "be used to extract specific studies from a data set, extract a " - "specific region of interest, or flip the images."; + "specific region of interest, or flip the images. Some of the possible " + "operations are described in more detail below." + + + "The -coord option is used to select the coordinates within the input " + "image that are to be retained in the output image. This can therefore " + "be used to include or exclude subsets of slices along a particular " + "spatial axis, or volumes / series within higher dimensions. " + "For instance: " + "-coord 3 0 extracts the first volume from a 4D image; " + "-coord 1 24 extracts slice number 24 along the y-axis." + + + "The colon operator can be particularly useful in conjunction with the " + "-coord option, in order to select multiple coordinates. " + "For instance: " + "-coord 3 1:59 " + "would select all but the first volume from an image containing 60 volumes." + + + "The -vox option is used to change the size of the voxels in the output " + "image. Note that this does not re-sample the image based on a new " + "voxel size (that is done using the mrresize command); this only changes " + "the voxel size as reported in the image header. Voxel sizes for " + "individual axes can be set independently, using a comma-separated list of " + "values; e.g. " + "-vox 1,,3.5 " + "will change the voxel size along the x & z axes to 1.0mm and 3.5mm " + "respectively, and leave the y-axis voxel size unchanged." + + + "The -axes option specifies which axes from the input image will be used " + "to form the output image. This allows the permutation, omission, or " + "addition of axes into the output image. The axes should be supplied as a " + "comma-separated list of axis indices, e.g. " + "-axes 0,1,2 " + "would select only the three spatial axes to form the output image. If an " + "axis from the input image is to be omitted from the output image, it must " + "have dimension 1; either in the input image itself, or a single coordinate " + "along that axis must be selected by the user by using the -coord option. " + "An axis of unity dimension can be inserted by supplying -1 at the " + "corresponding position in the list." + + + "The -scaling option specifies the data scaling parameters stored within " + "the image header that are used to rescale the image intensity values. " + "Where the raw data stored in a particular voxel is I, the value within " + "that voxel is interpreted as: " + "value = offset + (scale x I). " + "To adjust this scaling, the relevant parameters must be provided as a " + "comma-separated 2-vector of floating-point values, in the format " + "\"offset,scale\" (no quotation marks)." + + + "By default, the intensity scaling parameters in the input image header " + "are passed through to the output image header when writing to an integer " + "image, and reset to 0,1 (i.e. no scaling) for floating-point and binary " + "images. Note that the -scaling option will therefore have no effect for " + "floating-point or binary output images." + + + "Note that for both the -coord and -axes options, indexing starts from 0 " + "rather than 1. E.g. " + "-coord 3 <#> selects volumes (the fourth dimension) from the series; " + "-axes 0,1,2 includes only the three spatial axes in the output image."; ARGUMENTS + Argument ("input", "the input image.").type_image_in () + Argument ("output", "the output image.").type_image_out (); OPTIONS + + + OptionGroup ("Options for manipulating fundamental image properties") + + Option ("coord", - "extract data from the input image only at the coordinates specified.") + "retain data from the input image only at the coordinates specified") .allow_multiple() - + Argument ("axis").type_integer (0) - + Argument ("coord").type_sequence_int() + + Argument ("axis").type_integer (0) + + Argument ("coord").type_sequence_int() + Option ("vox", - "change the voxel dimensions of the output image. The new sizes should " - "be provided as a comma-separated list of values. Only those values " - "specified will be changed. For example: 1,,3.5 will change the voxel " - "size along the x & z axes, and leave the y-axis voxel size unchanged.") - + Argument ("sizes").type_sequence_float() + "change the voxel dimensions of the output image") + + Argument ("sizes").type_sequence_float() + Option ("axes", - "specify the axes from the input image that will be used to form the output " - "image. This allows the permutation, ommission, or addition of axes into the " - "output image. The axes should be supplied as a comma-separated list of axes. " - "Any ommitted axes must have dimension 1. Axes can be inserted by supplying " - "-1 at the corresponding position in the list.") - + Argument ("axes").type_sequence_int() + "specify the axes from the input image that will be used to form the output image") + + Argument ("axes").type_sequence_int() + Option ("scaling", - "specify the data scaling parameters used to rescale the intensity values. " - "These take the form of a comma-separated 2-vector of floating-point values, " - "corresponding to offset & scale, with final intensity values being given by " - "offset + scale * stored_value. " - "By default, the values in the input image header are passed through to the " - "output image header when writing to an integer image, and reset to 0,1 (no " - "scaling) for floating-point and binary images. Note that his option has no " - "effect for floating-point and binary images.") - + Argument ("values").type_sequence_float() + "specify the data scaling parameters used to rescale the intensity values") + + Argument ("values").type_sequence_float() + OptionGroup ("Options for handling JSON (JavaScript Object Notation) files") @@ -232,14 +279,14 @@ void copy_permute (const InputType& in, Header& header_out, const std::string& o template -void extract (Header& header_in, Header& header_out, const std::vector>& pos, const std::string& output_filename) +void extract (Header& header_in, Header& header_out, const vector>& pos, const std::string& output_filename) { auto in = header_in.get_image(); if (pos.empty()) { - copy_permute (in, header_out, output_filename); + copy_permute (in, header_out, output_filename); } else { auto extract = Adapter::make (in, pos); - copy_permute (extract, header_out, output_filename); + copy_permute (extract, header_out, output_filename); } } diff --git a/docs/reference/commands/mrconvert.rst b/docs/reference/commands/mrconvert.rst index f3d00a8317..1371bc9271 100644 --- a/docs/reference/commands/mrconvert.rst +++ b/docs/reference/commands/mrconvert.rst @@ -21,18 +21,35 @@ Usage Description ----------- -If used correctly, this program can be a very useful workhorse. In addition to converting images between different formats, it can be used to extract specific studies from a data set, extract a specific region of interest, or flip the images. +If used correctly, this program can be a very useful workhorse. In addition to converting images between different formats, it can be used to extract specific studies from a data set, extract a specific region of interest, or flip the images. Some of the possible operations are described in more detail below. + +The -coord option is used to select the coordinates within the input image that are to be retained in the output image. This can therefore be used to include or exclude subsets of slices along a particular spatial axis, or volumes / series within higher dimensions. For instance: -coord 3 0 extracts the first volume from a 4D image; -coord 1 24 extracts slice number 24 along the y-axis. + +The colon operator can be particularly useful in conjunction with the -coord option, in order to select multiple coordinates. For instance: -coord 3 1:59 would select all but the first volume from an image containing 60 volumes. + +The -vox option is used to change the size of the voxels in the output image. Note that this does not re-sample the image based on a new voxel size (that is done using the mrresize command); this only changes the voxel size as reported in the image header. Voxel sizes for individual axes can be set independently, using a comma-separated list of values; e.g. -vox 1,,3.5 will change the voxel size along the x & z axes to 1.0mm and 3.5mm respectively, and leave the y-axis voxel size unchanged. + +The -axes option specifies which axes from the input image will be used to form the output image. This allows the permutation, omission, or addition of axes into the output image. The axes should be supplied as a comma-separated list of axis indices, e.g. -axes 0,1,2 would select only the three spatial axes to form the output image. If an axis from the input image is to be omitted from the output image, it must have dimension 1; either in the input image itself, or a single coordinate along that axis must be selected by the user by using the -coord option. An axis of unity dimension can be inserted by supplying -1 at the corresponding position in the list. + +The -scaling option specifies the data scaling parameters stored within the image header that are used to rescale the image intensity values. Where the raw data stored in a particular voxel is I, the value within that voxel is interpreted as: value = offset + (scale x I). To adjust this scaling, the relevant parameters must be provided as a comma-separated 2-vector of floating-point values, in the format "offset,scale" (no quotation marks). + +By default, the intensity scaling parameters in the input image header are passed through to the output image header when writing to an integer image, and reset to 0,1 (i.e. no scaling) for floating-point and binary images. Note that the -scaling option will therefore have no effect for floating-point or binary output images. + +Note that for both the -coord and -axes options, indexing starts from 0 rather than 1. E.g. -coord 3 <#> selects volumes (the fourth dimension) from the series; -axes 0,1,2 includes only the three spatial axes in the output image. Options ------- -- **-coord axis coord** extract data from the input image only at the coordinates specified. +Options for manipulating fundamental image properties +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- **-coord axis coord** retain data from the input image only at the coordinates specified -- **-vox sizes** change the voxel dimensions of the output image. The new sizes should be provided as a comma-separated list of values. Only those values specified will be changed. For example: 1,,3.5 will change the voxel size along the x & z axes, and leave the y-axis voxel size unchanged. +- **-vox sizes** change the voxel dimensions of the output image -- **-axes axes** specify the axes from the input image that will be used to form the output image. This allows the permutation, ommission, or addition of axes into the output image. The axes should be supplied as a comma-separated list of axes. Any ommitted axes must have dimension 1. Axes can be inserted by supplying -1 at the corresponding position in the list. +- **-axes axes** specify the axes from the input image that will be used to form the output image -- **-scaling values** specify the data scaling parameters used to rescale the intensity values. These take the form of a comma-separated 2-vector of floating-point values, corresponding to offset & scale, with final intensity values being given by offset + scale * stored_value. By default, the values in the input image header are passed through to the output image header when writing to an integer image, and reset to 0,1 (no scaling) for floating-point and binary images. Note that his option has no effect for floating-point and binary images. +- **-scaling values** specify the data scaling parameters used to rescale the intensity values Options for handling JSON (JavaScript Object Notation) files ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -111,7 +128,7 @@ Standard options -**Author:** J-Donald Tournier (jdtournier@gmail.com) +**Author:** J-Donald Tournier (jdtournier@gmail.com) and Robert E. Smith (robert.smith@florey.edu.au) **Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. From fb53de0d644389a6d38e8eb8e00883f27dee3e86 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 21 Jul 2017 14:08:59 +1000 Subject: [PATCH 035/538] Fix compilation & docs update --- cmd/mrcalc.cpp | 2 +- core/fixel/legacy/image.h | 2 +- docs/reference/commands/amp2response.rst | 4 ++-- docs/reference/commands/amp2sh.rst | 2 +- docs/reference/commands/dwi2fod.rst | 2 +- docs/reference/commands/dwi2noise.rst | 2 +- docs/reference/commands/dwiextract.rst | 2 +- docs/reference/commands/mrcalc.rst | 2 ++ docs/reference/commands/tck2connectome.rst | 2 ++ docs/reference/commands/tckconvert.rst | 14 +++++++++++--- src/dwi/shells.cpp | 2 +- 11 files changed, 24 insertions(+), 12 deletions(-) diff --git a/cmd/mrcalc.cpp b/cmd/mrcalc.cpp index 156e5d514c..943373ebb0 100644 --- a/cmd/mrcalc.cpp +++ b/cmd/mrcalc.cpp @@ -1050,7 +1050,7 @@ class OpIf : public OpTernary { NOMEMALIGN class OpReplace : public OpTernary { public: - OpIf () : OpTernary ("(%1, %2 -> %3)") { } + OpReplace () : OpTernary ("(%1, %2 -> %3)") { } complex_type R (real_type a, real_type b, real_type c) const { return ((a==b) || (std::isnan(a) && std::isnan(b))) ? c : a; } complex_type Z (complex_type a, complex_type b, complex_type c) const { return (a==b) ? c : a; } }; diff --git a/core/fixel/legacy/image.h b/core/fixel/legacy/image.h index 3c25bc1e59..6c63cdc9fd 100644 --- a/core/fixel/legacy/image.h +++ b/core/fixel/legacy/image.h @@ -73,7 +73,7 @@ namespace MR friend std::ostream& operator<< (std::ostream& stream, const Value& value) { stream << "Position [ "; for (size_t n = 0; n < value.offsets.ndim(); ++n) - stream << value.offsets[n] << " "; + stream << value.offsets.index(n) << " "; stream << "], offset = " << value.offsets.value() << ", " << value.size() << " elements"; return stream; } diff --git a/docs/reference/commands/amp2response.rst b/docs/reference/commands/amp2response.rst index b7050877b2..e44a9ec92f 100644 --- a/docs/reference/commands/amp2response.rst +++ b/docs/reference/commands/amp2response.rst @@ -36,10 +36,10 @@ Options - **-directions path** provide an external text file containing the directions along which the amplitudes are sampled -DW Shell selection options +DW shell selection options ^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shell list** specify one or more diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. +- **-shells list** specify one or more diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. - **-lmax values** specify the maximum harmonic degree of the response function to estimate (can be a comma-separated list for multi-shell data) diff --git a/docs/reference/commands/amp2sh.rst b/docs/reference/commands/amp2sh.rst index 572ef1ec28..7a430cdbec 100644 --- a/docs/reference/commands/amp2sh.rst +++ b/docs/reference/commands/amp2sh.rst @@ -50,7 +50,7 @@ DW gradient table import options DW shell selection options ^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shells list** specify one (or more) diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. +- **-shells list** specify one or more diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. Stride options ^^^^^^^^^^^^^^ diff --git a/docs/reference/commands/dwi2fod.rst b/docs/reference/commands/dwi2fod.rst index 4267ef8e25..6c94bd86ee 100644 --- a/docs/reference/commands/dwi2fod.rst +++ b/docs/reference/commands/dwi2fod.rst @@ -39,7 +39,7 @@ DW gradient table import options DW shell selection options ^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shells list** specify one (or more) diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. +- **-shells list** specify one or more diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. Options common to more than one algorithm ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/reference/commands/dwi2noise.rst b/docs/reference/commands/dwi2noise.rst index 211bb88f5b..48ce32ac7d 100644 --- a/docs/reference/commands/dwi2noise.rst +++ b/docs/reference/commands/dwi2noise.rst @@ -40,7 +40,7 @@ DW gradient table import options DW shell selection options ^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shells list** specify one (or more) diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. +- **-shells list** specify one or more diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. Standard options ^^^^^^^^^^^^^^^^ diff --git a/docs/reference/commands/dwiextract.rst b/docs/reference/commands/dwiextract.rst index d99afec634..95a3482fb4 100644 --- a/docs/reference/commands/dwiextract.rst +++ b/docs/reference/commands/dwiextract.rst @@ -39,7 +39,7 @@ DW gradient table import options DW shell selection options ^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shells list** specify one (or more) diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. +- **-shells list** specify one or more diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. Options for importing phase-encode tables ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/reference/commands/mrcalc.rst b/docs/reference/commands/mrcalc.rst index cfd346b72e..535c62447c 100644 --- a/docs/reference/commands/mrcalc.rst +++ b/docs/reference/commands/mrcalc.rst @@ -136,6 +136,8 @@ Ternary operators - **-if** if first operand is true (non-zero), return second operand, otherwise return third operand +- **-replace** Wherever first operand is equal to the second operand, replace with third operand + Data type options ^^^^^^^^^^^^^^^^^ diff --git a/docs/reference/commands/tck2connectome.rst b/docs/reference/commands/tck2connectome.rst index 07d6cc27dd..de6bf80d1e 100644 --- a/docs/reference/commands/tck2connectome.rst +++ b/docs/reference/commands/tck2connectome.rst @@ -64,6 +64,8 @@ Other options for tck2connectome - **-out_assignments path** output the node assignments of each streamline to a file; this can be used subsequently e.g. by the command connectome2tck +- **-zero_diagonal** set all diagonal entries in the matrix to zero (these represent streamlines that connect to the same node at both ends) + - **-vector** output a vector representing connectivities from a given seed point to target nodes, rather than a matrix of node-node connectivities Standard options diff --git a/docs/reference/commands/tckconvert.rst b/docs/reference/commands/tckconvert.rst index 68bbbd56bb..dec3e10e69 100644 --- a/docs/reference/commands/tckconvert.rst +++ b/docs/reference/commands/tckconvert.rst @@ -21,7 +21,7 @@ Usage Description ----------- -The program currently supports MRtrix .tck files (input/output), ascii text files (input/output), and VTK polydata files (output only). +The program currently supports MRtrix .tck files (input/output), ascii text files (input/output), and VTK polydata files (input/output). Note that ascii files will be stored with one streamline per numbered file. To support this, the command will use the multi-file numbering syntax, where square brackets denote the position of the numbering for the files, for example: @@ -43,12 +43,20 @@ Options Options specific to PLY writer ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-radius radius** radius of the streamlines - - **-sides sides** number of sides for streamlines - **-increment increment** generate streamline points at every (increment) points +Options specific to RIB writer +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- **-dec** add DEC as a primvar + +Options for both PLY and RIB writer +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- **-radius radius** radius of the streamlines + Standard options ^^^^^^^^^^^^^^^^ diff --git a/src/dwi/shells.cpp b/src/dwi/shells.cpp index 81d279f901..8c65225ee1 100644 --- a/src/dwi/shells.cpp +++ b/src/dwi/shells.cpp @@ -26,7 +26,7 @@ namespace MR const App::OptionGroup ShellOption = App::OptionGroup ("DW shell selection options") + App::Option ("shells", - "specify one (or more) diffusion-weighted gradient shells to use during " + "specify one or more diffusion-weighted gradient shells to use during " "processing, as a comma-separated list of the desired approximate b-values. " "Note that some commands are incompatible with multiple shells, and " "will throw an error if more than one b-value is provided.") From db12adf64fc405f7c9e019841d908fca354db385 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 21 Jul 2017 16:50:41 +1000 Subject: [PATCH 036/538] labelconvert: Support for LPBA40 - Provide lookup table file for LPBA40 atlas as provided with SRI24 template. - Remove quotation marks from parcel names during lookup table import. - Add tests for labelconvert for IIT lookup table and LPBA40 atlas. --- share/mrtrix3/labelconvert/lpba40.txt | 60 +++++++++++++++++++++++++++ src/connectome/lut.cpp | 24 ++++------- testing/data | 2 +- testing/tests/labelconvert | 2 + 4 files changed, 72 insertions(+), 16 deletions(-) create mode 100644 share/mrtrix3/labelconvert/lpba40.txt diff --git a/share/mrtrix3/labelconvert/lpba40.txt b/share/mrtrix3/labelconvert/lpba40.txt new file mode 100644 index 0000000000..9291d27194 --- /dev/null +++ b/share/mrtrix3/labelconvert/lpba40.txt @@ -0,0 +1,60 @@ +# Lookup table for converting LPBA40 parcellation into a numerical scheme appropriate for connectome construction + +#Index Name Red Green Blue Alpha + 0 background 0 0 0 0 + 1 L_superior_frontal_gyrus 255 128 128 255 + 2 L_middle_frontal_gyrus 255 0 0 255 + 3 L_inferior_frontal_gyrus 128 127 0 255 + 4 L_precentral_gyrus 255 255 0 255 + 5 L_middle_orbitofrontal_gyrus 255 0 128 255 + 6 L_lateral_orbitofrontal_gyrus 128 0 255 255 + 7 L_gyrus_rectus 128 128 255 255 + 8 L_postcentral_gyrus 255 0 0 255 + 9 L_superior_parietal_gyrus 127 128 0 255 +10 L_supramarginal_gyrus 255 255 0 255 +11 L_angular_gyrus 255 128 255 255 +12 L_precuneus 128 255 128 255 +13 L_superior_occipital_gyrus 127 127 255 255 +14 L_middle_occipital_gyrus 255 127 128 255 +15 L_inferior_occipital_gyrus 160 0 0 255 +16 L_cuneus 255 255 127 255 +17 L_superior_temporal_gyrus 128 0 64 255 +18 L_middle_temporal_gyrus 92 92 237 255 +19 L_inferior_temporal_gyrus 17 207 255 255 +20 L_parahippocampal_gyrus 105 180 31 255 +21 L_lingual_gyrus 255 255 0 255 +22 L_fusiform_gyrus 35 231 216 255 +23 L_insular_cortex 128 255 0 255 +24 L_cingulate_gyrus 64 128 255 255 +25 L_caudate 48 255 0 255 +26 L_putamen 128 160 48 255 +27 L_hippocampus 133 10 31 255 +28 cerebellum 240 128 48 255 +29 brainstem 128 255 0 255 +30 R_caudate 255 0 128 255 +31 R_putamen 255 128 0 255 +32 R_hippocampus 255 255 0 255 +33 R_superior_frontal_gyrus 255 128 0 255 +34 R_middle_frontal_gyrus 255 128 255 255 +35 R_inferior_frontal_gyrus 255 0 0 255 +36 R_precentral_gyrus 128 0 0 255 +37 R_middle_orbitofrontal_gyrus 128 128 64 255 +38 R_lateral_orbitofrontal_gyrus 255 128 127 255 +39 R_gyrus_rectus 255 255 0 255 +40 R_postcentral_gyrus 128 128 64 255 +41 R_superior_parietal_gyrus 255 255 0 255 +42 R_supramarginal_gyrus 128 128 0 255 +43 R_angular_gyrus 64 0 128 255 +44 R_precuneus 255 0 0 255 +45 R_superior_occipital_gyrus 255 127 0 255 +46 R_middle_occipital_gyrus 127 0 0 255 +47 R_inferior_occipital_gyrus 83 166 166 255 +48 R_cuneus 128 0 0 255 +49 R_superior_temporal_gyrus 128 255 0 255 +50 R_middle_temporal_gyrus 192 128 255 255 +51 R_inferior_temporal_gyrus 255 0 128 255 +52 R_parahippocampal_gyrus 64 255 0 255 +53 R_lingual_gyrus 255 255 0 255 +54 R_fusiform_gyrus 255 0 0 255 +55 R_insular_cortex 128 255 255 255 +56 R_cingulate_gyrus 255 0 255 255 diff --git a/src/connectome/lut.cpp b/src/connectome/lut.cpp index 5942100c30..f871929bec 100644 --- a/src/connectome/lut.cpp +++ b/src/connectome/lut.cpp @@ -16,6 +16,8 @@ #include +#include "mrtrix.h" // For strip() + namespace MR { @@ -24,7 +26,6 @@ namespace Connectome { - LUT::LUT (const std::string& path) : exclusive (true) { @@ -206,7 +207,7 @@ void LUT::parse_line_basic (const std::string& line) char name [80]; sscanf (line.c_str(), "%u %s", &index, name); if (index != std::numeric_limits::max()) { - const std::string strname (name); + const std::string strname (strip(name, " \t\n\"")); check_and_insert (index, LUT_node (strname)); } } @@ -219,7 +220,7 @@ void LUT::parse_line_freesurfer (const std::string& line) if (index != std::numeric_limits::max()) { if (std::max ({r, g, b}) > 255) throw Exception ("Lookup table is malformed"); - const std::string strname (name); + const std::string strname (strip(name, " \t\n\"")); check_and_insert (index, LUT_node (strname, r, g, b, a)); } } @@ -229,8 +230,8 @@ void LUT::parse_line_aal (const std::string& line) char short_name[20], name [80]; sscanf (line.c_str(), "%s %s %u", short_name, name, &index); if (index != std::numeric_limits::max()) { - const std::string strshortname (short_name); - const std::string strname (name); + const std::string strshortname (strip(short_name, " \t\n\"")); + const std::string strname (strip(name, " \t\n\"")); check_and_insert (index, LUT_node (strname, strshortname)); } } @@ -243,14 +244,7 @@ void LUT::parse_line_itksnap (const std::string& line) char name [80]; sscanf (line.c_str(), "%u %u %u %u %f %u %u %s", &index, &r, &g, &b, &a, &label_vis, &mesh_vis, name); if (index != std::numeric_limits::max()) { - std::string strname (name); - size_t first = strname.find_first_not_of ('\"'); - if (first == std::string::npos) - first = 0; - size_t last = strname.find_last_not_of ('\"'); - if (last == std::string::npos) - last = strname.size() - 1; - strname = strname.substr (first, last - first + 1); + std::string strname (strip(name, " \t\n\"")); check_and_insert (index, LUT_node (strname, r, g, b, uint8_t(a*255.0))); } } @@ -263,8 +257,8 @@ void LUT::parse_line_mrtrix (const std::string& line) if (index != std::numeric_limits::max()) { if (std::max ({r, g, b}) > 255) throw Exception ("Lookup table is malformed"); - const std::string strshortname (short_name); - const std::string strname (name); + const std::string strshortname (strip(short_name, " \t\n\"")); + const std::string strname (strip(name, " \t\n\"")); check_and_insert (index, LUT_node (strname, strshortname, r, g, b, a)); } } diff --git a/testing/data b/testing/data index add3412305..24457b3a66 160000 --- a/testing/data +++ b/testing/data @@ -1 +1 @@ -Subproject commit add34123053ec1ab5fb207f5225204c3eadf4e84 +Subproject commit 24457b3a664e5aa3b9e24a1ecb6cf064f1754a3c diff --git a/testing/tests/labelconvert b/testing/tests/labelconvert index 0c63643306..894680aaf1 100644 --- a/testing/tests/labelconvert +++ b/testing/tests/labelconvert @@ -1,2 +1,4 @@ labelconvert labelconvert/in_aal.mif.gz labelconvert/ROI_MNI_V4.txt labelconvert/aal.txt - | testing_diff_image - labelconvert/out_aal.mif.gz labelconvert labelconvert/in_fs.mif.gz labelconvert/FreeSurferColorLUT.txt labelconvert/fs_default.txt - | testing_diff_image - labelconvert/out_fs.mif.gz +labelconvert labelconvert/in_iit.mif.gz labelconvert/LUT_GM.txt labelconvert/fs_a2009s.txt - | testing_diff_image - labelconvert/out_iit.mif.gz +labelconvert labelconvert/in_lpba40.mif.gz labelconvert/LPBA40-labels.txt lpba40.txt - | testing_diff_image - labelconvert/out_lpba40.mif.gz From 9fc41f3a96a69f22c6422a89a3efcd8a2b988cad Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 21 Jul 2017 16:53:13 +1000 Subject: [PATCH 037/538] mrtransform & mrresize: Fix nearest-neighbour downsampling When using nearest-neighbour interpolation and mapping to a lower-resolution image, if the default oversampling strategy is used, this will result in averaging of sub-voxel samples and therefore output intensities that do include some degree of "interpolation" with respect to the input image. This change disables oversampling when using nearest-neighbour interpolation. --- cmd/mrtransform.cpp | 2 +- core/filter/resize.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/mrtransform.cpp b/cmd/mrtransform.cpp index 4133cf3448..41bb4eeb96 100644 --- a/cmd/mrtransform.cpp +++ b/cmd/mrtransform.cpp @@ -478,7 +478,7 @@ void run () switch (interp) { case 0: - Filter::reslice (input, output, linear_transform, Adapter::AutoOverSample, out_of_bounds_value); + Filter::reslice (input, output, linear_transform, { 1, 1, 1 }, out_of_bounds_value); break; case 1: Filter::reslice (input, output, linear_transform, Adapter::AutoOverSample, out_of_bounds_value); diff --git a/core/filter/resize.h b/core/filter/resize.h index 7ba663c20b..e656671f01 100644 --- a/core/filter/resize.h +++ b/core/filter/resize.h @@ -131,7 +131,8 @@ namespace MR { switch (interp_type) { case 0: - reslice (input, output); + // Prevent use of oversampling when using nearest-neighbour interpolation + reslice (input, output, Adapter::NoTransform, { 1, 1, 1 }); break; case 1: reslice (input, output); From b89f386c92a3209d0b0931934bae08fe30be77b8 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 24 Jul 2017 14:58:59 +1000 Subject: [PATCH 038/538] tckgen: Fix linking issues using .cpp files and explicit inling --- src/dwi/tractography/algorithms/calibrator.h | 3 +- src/dwi/tractography/algorithms/iFOD2.h | 11 +- src/dwi/tractography/tracking/method.cpp | 128 ++++++++++ src/dwi/tractography/tracking/method.h | 119 ++-------- src/dwi/tractography/tracking/shared.cpp | 232 +++++++++++++++++++ src/dwi/tractography/tracking/shared.h | 203 +--------------- 6 files changed, 388 insertions(+), 308 deletions(-) create mode 100644 src/dwi/tractography/tracking/method.cpp create mode 100644 src/dwi/tractography/tracking/shared.cpp diff --git a/src/dwi/tractography/algorithms/calibrator.h b/src/dwi/tractography/algorithms/calibrator.h index e50e68b4c2..36e5b7149d 100644 --- a/src/dwi/tractography/algorithms/calibrator.h +++ b/src/dwi/tractography/algorithms/calibrator.h @@ -15,6 +15,7 @@ #ifndef __dwi_tractography_algorithms_iFOD_calibrator_h__ #define __dwi_tractography_algorithms_iFOD_calibrator_h__ +#include "types.h" #include "math/SH.h" #include "dwi/tractography/tracking/shared.h" #include "dwi/tractography/tracking/types.h" @@ -29,7 +30,7 @@ namespace MR { using namespace MR::DWI::Tractography::Tracking; - vector direction_grid (float max_angle, float spacing) + FORCE_INLINE vector direction_grid (float max_angle, float spacing) { const float maxR = Math::pow2 (max_angle / spacing); vector list; diff --git a/src/dwi/tractography/algorithms/iFOD2.h b/src/dwi/tractography/algorithms/iFOD2.h index 6b4ca93f88..c0aed44c6f 100644 --- a/src/dwi/tractography/algorithms/iFOD2.h +++ b/src/dwi/tractography/algorithms/iFOD2.h @@ -17,6 +17,7 @@ #include +#include "types.h" #include "math/SH.h" #include "dwi/tractography/properties.h" #include "dwi/tractography/tracking/method.h" @@ -280,7 +281,7 @@ namespace MR } - float get_metric() + FORCE_INLINE float get_metric() { return FOD (dir); } @@ -349,7 +350,7 @@ namespace MR - float FOD (const Eigen::Vector3f& direction) const + FORCE_INLINE float FOD (const Eigen::Vector3f& direction) const { return (S.precomputer ? S.precomputer.value (values, direction) : @@ -357,7 +358,7 @@ namespace MR ); } - float FOD (const Eigen::Vector3f& position, const Eigen::Vector3f& direction) + FORCE_INLINE float FOD (const Eigen::Vector3f& position, const Eigen::Vector3f& direction) { if (!get_data (source, position)) return NaN; @@ -367,7 +368,7 @@ namespace MR - float rand_path_prob () + FORCE_INLINE float rand_path_prob () { get_path (positions, tangents, rand_dir (dir)); return path_prob (positions, tangents); @@ -443,7 +444,7 @@ namespace MR - Eigen::Vector3f rand_dir (const Eigen::Vector3f& d) { return (random_direction (d, S.max_angle, S.sin_max_angle)); } + FORCE_INLINE Eigen::Vector3f rand_dir (const Eigen::Vector3f& d) { return (random_direction (d, S.max_angle, S.sin_max_angle)); } diff --git a/src/dwi/tractography/tracking/method.cpp b/src/dwi/tractography/tracking/method.cpp new file mode 100644 index 0000000000..b98af03ffd --- /dev/null +++ b/src/dwi/tractography/tracking/method.cpp @@ -0,0 +1,128 @@ +/* Copyright (c) 2008-2017 the MRtrix3 contributors. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * + * MRtrix is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * For more details, see http://www.mrtrix.org/. + */ + + +#include "dwi/tractography/tracking/method.h" + + + +namespace MR +{ + namespace DWI + { + namespace Tractography + { + namespace Tracking + { + + + + bool MethodBase::check_seed() + { + if (!pos.allFinite()) + return false; + + if ((S.properties.mask.size() && !S.properties.mask.contains (pos)) + || (S.properties.exclude.contains (pos)) + || (S.is_act() && !act().check_seed (pos))) { + pos = { NaN, NaN, NaN }; + return false; + } + + return true; + } + + + + void MethodBase::truncate_track (GeneratedTrack& tck, const size_t length_to_revert_from, const size_t revert_step) + { + if (tck.get_seed_index() + revert_step >= length_to_revert_from) { + tck.clear(); + pos = { NaN, NaN, NaN }; + dir = { NaN, NaN, NaN }; + return; + } + const size_t new_size = length_to_revert_from - revert_step; + if (tck.size() == 2 || new_size == 1) + dir = (tck[1] - tck[0]).normalized(); + else + dir = (tck[new_size] - tck[new_size - 2]).normalized(); + tck.resize (length_to_revert_from - revert_step); + pos = tck.back(); + if (S.is_act()) + act().sgm_depth = (act().sgm_depth > revert_step) ? act().sgm_depth - revert_step : 0; + } + + + + Eigen::Vector3f MethodBase::random_direction () + { + Eigen::Vector3f d; + do { + d[0] = 2.0 * uniform(*rng) - 1.0; + d[1] = 2.0 * uniform(*rng) - 1.0; + d[2] = 2.0 * uniform(*rng) - 1.0; + } while (d.squaredNorm() > 1.0); + d.normalize(); + return d; + } + + + Eigen::Vector3f MethodBase::random_direction (const float max_angle, const float sin_max_angle) + { + float phi = 2.0 * Math::pi * uniform(*rng); + float theta; + do { + theta = max_angle * uniform(*rng); + } while (sin_max_angle * uniform(*rng) > sin (theta)); + return Eigen::Vector3f (sin(theta)*cos(phi), sin(theta)*sin(phi), cos(theta)); + } + + + Eigen::Vector3f MethodBase::random_direction (const Eigen::Vector3f& d, const float max_angle, const float sin_max_angle) + { + return rotate_direction (d, random_direction (max_angle, sin_max_angle)); + } + + + Eigen::Vector3f MethodBase::rotate_direction (const Eigen::Vector3f& reference, const Eigen::Vector3f& direction) + { + float n = std::sqrt (Math::pow2(reference[0]) + Math::pow2(reference[1])); + if (n == 0.0) { + if (reference[2] < 0.0) + return -direction; + else + return direction; + } + + Eigen::Vector3f m (reference[0]/n, reference[1]/n, 0.0f); + Eigen::Vector3f mp (reference[2]*m[0], reference[2]*m[1], -n); + + float alpha = direction[2]; + float beta = direction[0]*m[0] + direction[1]*m[1]; + + return { + direction[0] + alpha * reference[0] + beta * (mp[0] - m[0]), + direction[1] + alpha * reference[1] + beta * (mp[1] - m[1]), + direction[2] + alpha * (reference[2]-1.0f) + beta * (mp[2] - m[2]) + }; + } + + + + } + } + } +} + + diff --git a/src/dwi/tractography/tracking/method.h b/src/dwi/tractography/tracking/method.h index 8611d742f2..77f8eb1d24 100644 --- a/src/dwi/tractography/tracking/method.h +++ b/src/dwi/tractography/tracking/method.h @@ -53,37 +53,21 @@ namespace MR values (that.values.size()) { } - - bool check_seed() + template + FORCE_INLINE bool get_data (InterpolatorType& source, const Eigen::Vector3f& position) { - if (!pos.allFinite()) - return false; - - if ((S.properties.mask.size() && !S.properties.mask.contains (pos)) - || (S.properties.exclude.contains (pos)) - || (S.is_act() && !act().check_seed (pos))) { - pos = { NaN, NaN, NaN }; + if (!source.scanner (position)) return false; - } - - return true; + for (auto l = Loop (3) (source); l; ++l) + values[source.index(3)] = source.value(); + return !std::isnan (values[0]); } - - template - inline bool get_data (InterpolatorType& source, const Eigen::Vector3f& position) - { - if (!source.scanner (position)) - return false; - for (auto l = Loop (3) (source); l; ++l) - values[source.index(3)] = source.value(); - return !std::isnan (values[0]); - } - template - inline bool get_data (InterpolatorType& source) { - return get_data (source, pos); - } + FORCE_INLINE bool get_data (InterpolatorType& source) + { + return get_data (source, pos); + } virtual void reverse_track() { if (act_method_additions) act().reverse_track(); } @@ -91,26 +75,8 @@ namespace MR term_t next() { return term_t(); } float get_metric() { return NaN; } - - void truncate_track (GeneratedTrack& tck, const size_t length_to_revert_from, const size_t revert_step) - { - if (tck.get_seed_index() + revert_step >= length_to_revert_from) { - tck.clear(); - pos = { NaN, NaN, NaN }; - dir = { NaN, NaN, NaN }; - return; - } - const size_t new_size = length_to_revert_from - revert_step; - if (tck.size() == 2 || new_size == 1) - dir = (tck[1] - tck[0]).normalized(); - else - dir = (tck[new_size] - tck[new_size - 2]).normalized(); - tck.resize (length_to_revert_from - revert_step); - pos = tck.back(); - if (S.is_act()) - act().sgm_depth = (act().sgm_depth > revert_step) ? act().sgm_depth - revert_step : 0; - } - + bool check_seed(); + void truncate_track (GeneratedTrack& tck, const size_t length_to_revert_from, const size_t revert_step); ACT::ACT_Method_additions& act() const { return *act_method_additions; } @@ -127,71 +93,14 @@ namespace MR Eigen::VectorXf values; Eigen::Vector3f random_direction (); - Eigen::Vector3f random_direction (float max_angle, float sin_max_angle); - Eigen::Vector3f random_direction (const Eigen::Vector3f& d, float max_angle, float sin_max_angle); + Eigen::Vector3f random_direction (const float max_angle, const float sin_max_angle); + Eigen::Vector3f random_direction (const Eigen::Vector3f& d, const float max_angle, const float sin_max_angle); Eigen::Vector3f rotate_direction (const Eigen::Vector3f& reference, const Eigen::Vector3f& direction); }; - - - - Eigen::Vector3f MethodBase::random_direction () - { - Eigen::Vector3f d; - do { - d[0] = 2.0 * uniform(*rng) - 1.0; - d[1] = 2.0 * uniform(*rng) - 1.0; - d[2] = 2.0 * uniform(*rng) - 1.0; - } while (d.squaredNorm() > 1.0); - d.normalize(); - return d; - } - - - Eigen::Vector3f MethodBase::random_direction (float max_angle, float sin_max_angle) - { - float phi = 2.0 * Math::pi * uniform(*rng); - float theta; - do { - theta = max_angle * uniform(*rng); - } while (sin_max_angle * uniform(*rng) > sin (theta)); - return Eigen::Vector3f (sin(theta)*cos(phi), sin(theta)*sin(phi), cos(theta)); - } - - - Eigen::Vector3f MethodBase::random_direction (const Eigen::Vector3f& d, float max_angle, float sin_max_angle) - { - return rotate_direction (d, random_direction (max_angle, sin_max_angle)); - } - - - Eigen::Vector3f MethodBase::rotate_direction (const Eigen::Vector3f& reference, const Eigen::Vector3f& direction) - { - float n = std::sqrt (Math::pow2(reference[0]) + Math::pow2(reference[1])); - if (n == 0.0) { - if (reference[2] < 0.0) - return -direction; - else - return direction; - } - - Eigen::Vector3f m (reference[0]/n, reference[1]/n, 0.0f); - Eigen::Vector3f mp (reference[2]*m[0], reference[2]*m[1], -n); - - float alpha = direction[2]; - float beta = direction[0]*m[0] + direction[1]*m[1]; - - return { - direction[0] + alpha * reference[0] + beta * (mp[0] - m[0]), - direction[1] + alpha * reference[1] + beta * (mp[1] - m[1]), - direction[2] + alpha * (reference[2]-1.0f) + beta * (mp[2] - m[2]) - }; - } - - } } } diff --git a/src/dwi/tractography/tracking/shared.cpp b/src/dwi/tractography/tracking/shared.cpp new file mode 100644 index 0000000000..7e3366154a --- /dev/null +++ b/src/dwi/tractography/tracking/shared.cpp @@ -0,0 +1,232 @@ +/* Copyright (c) 2008-2017 the MRtrix3 contributors. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * + * MRtrix is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * For more details, see http://www.mrtrix.org/. + */ + + +#include "dwi/tractography/tracking/shared.h" + + +namespace MR +{ + namespace DWI + { + namespace Tractography + { + namespace Tracking + { + + + + SharedBase::SharedBase (const std::string& diff_path, Properties& property_set) : + source (Image::open (diff_path).with_direct_io (3)), + properties (property_set), + init_dir ({ NaN, NaN, NaN }), + min_num_points (0), + max_num_points (0), + max_angle (NaN), + max_angle_rk4 (NaN), + cos_max_angle (NaN), + cos_max_angle_rk4 (NaN), + step_size (NaN), + threshold (0.1), + unidirectional (false), + rk4 (false), + stop_on_all_include (false), + implicit_max_num_seeds (properties.find ("max_num_seeds") == properties.end()), + downsampler () +#ifdef DEBUG_TERMINATIONS + , debug_header (Header::open (properties.find ("act") == properties.end() ? diff_path : properties["act"])), + transform (debug_header) +#endif + { + if (properties.find ("max_num_tracks") == properties.end()) + max_num_tracks = (properties.find ("max_num_seeds") == properties.end()) ? TCKGEN_DEFAULT_NUM_SELECTED_TRACKS : 0; + properties.set (max_num_tracks, "max_num_tracks"); + + properties.set (threshold, "threshold"); + properties.set (unidirectional, "unidirectional"); + properties.set (rk4, "rk4"); + properties.set (stop_on_all_include, "stop_on_all_include"); + + properties["source"] = source.name(); + + init_threshold = threshold; + properties.set (init_threshold, "init_threshold"); + + max_num_seeds = TCKGEN_DEFAULT_SEED_TO_SELECT_RATIO * max_num_tracks; + properties.set (max_num_seeds, "max_num_seeds"); + + assert (properties.seeds.num_seeds()); + max_seed_attempts = properties.seeds[0]->get_max_attempts(); + properties.set (max_seed_attempts, "max_seed_attempts"); + + if (properties.find ("init_direction") != properties.end()) { + auto V = parse_floats (properties["init_direction"]); + if (V.size() != 3) throw Exception (std::string ("invalid initial direction \"") + properties["init_direction"] + "\""); + init_dir[0] = V[0]; + init_dir[1] = V[1]; + init_dir[2] = V[2]; + init_dir.normalize(); + } + + if (properties.find ("act") != properties.end()) { + act_shared_additions.reset (new ACT::ACT_Shared_additions (properties["act"], property_set)); + if (act().backtrack() && stop_on_all_include) + throw Exception ("Cannot use -stop option if ACT backtracking is enabled"); + } + + if (properties.find ("downsample_factor") != properties.end()) + downsampler.set_ratio (to (properties["downsample_factor"])); + + for (size_t i = 0; i != TERMINATION_REASON_COUNT; ++i) + terminations[i] = 0; + for (size_t i = 0; i != REJECTION_REASON_COUNT; ++i) + rejections[i] = 0; + +#ifdef DEBUG_TERMINATIONS + debug_header.ndim() = 3; + debug_header.datatype() = DataType::UInt32; + for (size_t i = 0; i != TERMINATION_REASON_COUNT; ++i) { + std::string name; + switch (i) { + case CONTINUE: name = "undefined"; break; + case ENTER_CGM: name = "enter_cgm"; break; + case CALIBRATOR: name = "calibrator"; break; + case EXIT_IMAGE: name = "exit_image"; break; + case ENTER_CSF: name = "enter_csf"; break; + case BAD_SIGNAL: name = "bad_signal"; break; + case HIGH_CURVATURE: name = "curvature"; break; + case LENGTH_EXCEED: name = "max_length"; break; + case TERM_IN_SGM: name = "term_in_sgm"; break; + case EXIT_SGM: name = "exit_sgm"; break; + case EXIT_MASK: name = "exit_mask"; break; + case ENTER_EXCLUDE: name = "enter_exclude"; break; + case TRAVERSE_ALL_INCLUDE: name = "all_include"; break; + } + debug_images[i] = new Image (Image::create ("terms_" + name + ".mif", debug_header)); + } +#endif + + } + + + SharedBase::~SharedBase() + { + size_t sum_terminations = 0; + for (size_t i = 0; i != TERMINATION_REASON_COUNT; ++i) + sum_terminations += terminations[i]; + INFO ("Total number of track terminations: " + str (sum_terminations)); + INFO ("Termination reason probabilities:"); + for (size_t i = 0; i != TERMINATION_REASON_COUNT; ++i) { + std::string term_type; + bool to_print = false; + switch (i) { + case CONTINUE: term_type = "Unknown"; to_print = false; break; + case ENTER_CGM: term_type = "Entered cortical grey matter"; to_print = is_act(); break; + case CALIBRATOR: term_type = "Calibrator sub-threshold"; to_print = true; break; + case EXIT_IMAGE: term_type = "Exited image"; to_print = true; break; + case ENTER_CSF: term_type = "Entered CSF"; to_print = is_act(); break; + case BAD_SIGNAL: term_type = "Bad diffusion signal"; to_print = true; break; + case HIGH_CURVATURE: term_type = "Excessive curvature"; to_print = true; break; + case LENGTH_EXCEED: term_type = "Max length exceeded"; to_print = true; break; + case TERM_IN_SGM: term_type = "Terminated in subcortex"; to_print = is_act(); break; + case EXIT_SGM: term_type = "Exiting sub-cortical GM"; to_print = is_act(); break; + case EXIT_MASK: term_type = "Exited mask"; to_print = properties.mask.size(); break; + case ENTER_EXCLUDE: term_type = "Entered exclusion region"; to_print = properties.exclude.size(); break; + case TRAVERSE_ALL_INCLUDE: term_type = "Traversed all include regions"; to_print = stop_on_all_include; break; + } + if (to_print) + INFO (" " + term_type + ": " + str (100.0 * terminations[i] / (double)sum_terminations, 3) + "\%"); + } + + INFO ("Track rejection counts:"); + for (size_t i = 0; i != REJECTION_REASON_COUNT; ++i) { + std::string reject_type; + bool to_print = false; + switch (i) { + case INVALID_SEED: reject_type = "Invalid seed point"; to_print = true; break; + case NO_PROPAGATION_FROM_SEED: reject_type = "No propagation from seed"; to_print = true; break; + case TRACK_TOO_SHORT: reject_type = "Shorter than minimum length"; to_print = true; break; + case TRACK_TOO_LONG: reject_type = "Longer than maximum length"; to_print = is_act(); break; + case ENTER_EXCLUDE_REGION: reject_type = "Entered exclusion region"; to_print = properties.exclude.size(); break; + case MISSED_INCLUDE_REGION: reject_type = "Missed inclusion region"; to_print = properties.include.size(); break; + case ACT_POOR_TERMINATION: reject_type = "Poor structural termination"; to_print = is_act(); break; + case ACT_FAILED_WM_REQUIREMENT: reject_type = "Failed to traverse white matter"; to_print = is_act(); break; + } + if (to_print) + INFO (" " + reject_type + ": " + str (rejections[i])); + } + +#ifdef DEBUG_TERMINATIONS + for (size_t i = 0; i != TERMINATION_REASON_COUNT; ++i) { + delete debug_images[i]; + debug_images[i] = NULL; + } +#endif + } + + + + void SharedBase::set_step_size (float stepsize) + { + step_size = stepsize * vox(); + properties.set (step_size, "step_size"); + INFO ("step size = " + str (step_size) + " mm"); + + if (downsampler.get_ratio() > 1) + properties["output_step_size"] = str (step_size * downsampler.get_ratio()); + + float max_dist = 100.0 * vox(); + properties.set (max_dist, "max_dist"); + max_num_points = std::round (max_dist/step_size) + 1; + + float min_dist = is_act() ? (2.0 * vox()) : (5.0 * vox()); + properties.set (min_dist, "min_dist"); + min_num_points = std::max (2, int(std::round (min_dist/step_size) + 1)); + + max_angle = 90.0 * step_size / vox(); + properties.set (max_angle, "max_angle"); + INFO ("maximum deviation angle = " + str (max_angle) + " deg"); + max_angle *= Math::pi / 180.0; + cos_max_angle = std::cos (max_angle); + + if (rk4) { + max_angle_rk4 = max_angle; + cos_max_angle_rk4 = cos_max_angle; + max_angle = Math::pi; + cos_max_angle = 0.0; + } + } + + + +#ifdef DEBUG_TERMINATIONS + void SharedBase::add_termination (const term_t i, const Eigen::Vector3f& p) const + { + terminations[i].fetch_add (1, std::memory_order_relaxed); + Image image (*debug_images[i]); + const auto pv = transform.scanner2voxel * p.cast(); + image.index(0) = ssize_t (std::round (pv[0])); + image.index(1) = ssize_t (std::round (pv[1])); + image.index(2) = ssize_t (std::round (pv[2])); + if (!is_out_of_bounds (image)) + image.value() += 1; + } +#endif + + + + } + } + } +} + diff --git a/src/dwi/tractography/tracking/shared.h b/src/dwi/tractography/tracking/shared.h index d14a33ec1f..e9900e4d43 100644 --- a/src/dwi/tractography/tracking/shared.h +++ b/src/dwi/tractography/tracking/shared.h @@ -45,164 +45,13 @@ namespace MR - - - class SharedBase { MEMALIGN(SharedBase) public: - SharedBase (const std::string& diff_path, Properties& property_set) : - - source (Image::open (diff_path).with_direct_io (3)), - properties (property_set), - init_dir ({ NaN, NaN, NaN }), - min_num_points (0), - max_num_points (0), - max_angle (NaN), - max_angle_rk4 (NaN), - cos_max_angle (NaN), - cos_max_angle_rk4 (NaN), - step_size (NaN), - threshold (0.1), - unidirectional (false), - rk4 (false), - stop_on_all_include (false), - implicit_max_num_seeds (properties.find ("max_num_seeds") == properties.end()), - downsampler () -#ifdef DEBUG_TERMINATIONS - , debug_header (Header::open (properties.find ("act") == properties.end() ? diff_path : properties["act"])), - transform (debug_header) -#endif - { - - if (properties.find ("max_num_tracks") == properties.end()) - max_num_tracks = (properties.find ("max_num_seeds") == properties.end()) ? TCKGEN_DEFAULT_NUM_SELECTED_TRACKS : 0; - properties.set (max_num_tracks, "max_num_tracks"); - - properties.set (threshold, "threshold"); - properties.set (unidirectional, "unidirectional"); - properties.set (rk4, "rk4"); - properties.set (stop_on_all_include, "stop_on_all_include"); - - properties["source"] = source.name(); - - init_threshold = threshold; - properties.set (init_threshold, "init_threshold"); - - max_num_seeds = TCKGEN_DEFAULT_SEED_TO_SELECT_RATIO * max_num_tracks; - properties.set (max_num_seeds, "max_num_seeds"); - - assert (properties.seeds.num_seeds()); - max_seed_attempts = properties.seeds[0]->get_max_attempts(); - properties.set (max_seed_attempts, "max_seed_attempts"); - - if (properties.find ("init_direction") != properties.end()) { - auto V = parse_floats (properties["init_direction"]); - if (V.size() != 3) throw Exception (std::string ("invalid initial direction \"") + properties["init_direction"] + "\""); - init_dir[0] = V[0]; - init_dir[1] = V[1]; - init_dir[2] = V[2]; - init_dir.normalize(); - } - - if (properties.find ("act") != properties.end()) { - act_shared_additions.reset (new ACT::ACT_Shared_additions (properties["act"], property_set)); - if (act().backtrack() && stop_on_all_include) - throw Exception ("Cannot use -stop option if ACT backtracking is enabled"); - } - - if (properties.find ("downsample_factor") != properties.end()) - downsampler.set_ratio (to (properties["downsample_factor"])); - - for (size_t i = 0; i != TERMINATION_REASON_COUNT; ++i) - terminations[i] = 0; - for (size_t i = 0; i != REJECTION_REASON_COUNT; ++i) - rejections[i] = 0; - -#ifdef DEBUG_TERMINATIONS - debug_header.ndim() = 3; - debug_header.datatype() = DataType::UInt32; - for (size_t i = 0; i != TERMINATION_REASON_COUNT; ++i) { - std::string name; - switch (i) { - case CONTINUE: name = "undefined"; break; - case ENTER_CGM: name = "enter_cgm"; break; - case CALIBRATOR: name = "calibrator"; break; - case EXIT_IMAGE: name = "exit_image"; break; - case ENTER_CSF: name = "enter_csf"; break; - case BAD_SIGNAL: name = "bad_signal"; break; - case HIGH_CURVATURE: name = "curvature"; break; - case LENGTH_EXCEED: name = "max_length"; break; - case TERM_IN_SGM: name = "term_in_sgm"; break; - case EXIT_SGM: name = "exit_sgm"; break; - case EXIT_MASK: name = "exit_mask"; break; - case ENTER_EXCLUDE: name = "enter_exclude"; break; - case TRAVERSE_ALL_INCLUDE: name = "all_include"; break; - } - debug_images[i] = new Image (Image::create ("terms_" + name + ".mif", debug_header)); - } -#endif - - } - - - virtual ~SharedBase() - { - - size_t sum_terminations = 0; - for (size_t i = 0; i != TERMINATION_REASON_COUNT; ++i) - sum_terminations += terminations[i]; - INFO ("Total number of track terminations: " + str (sum_terminations)); - INFO ("Termination reason probabilities:"); - for (size_t i = 0; i != TERMINATION_REASON_COUNT; ++i) { - std::string term_type; - bool to_print = false; - switch (i) { - case CONTINUE: term_type = "Unknown"; to_print = false; break; - case ENTER_CGM: term_type = "Entered cortical grey matter"; to_print = is_act(); break; - case CALIBRATOR: term_type = "Calibrator sub-threshold"; to_print = true; break; - case EXIT_IMAGE: term_type = "Exited image"; to_print = true; break; - case ENTER_CSF: term_type = "Entered CSF"; to_print = is_act(); break; - case BAD_SIGNAL: term_type = "Bad diffusion signal"; to_print = true; break; - case HIGH_CURVATURE: term_type = "Excessive curvature"; to_print = true; break; - case LENGTH_EXCEED: term_type = "Max length exceeded"; to_print = true; break; - case TERM_IN_SGM: term_type = "Terminated in subcortex"; to_print = is_act(); break; - case EXIT_SGM: term_type = "Exiting sub-cortical GM"; to_print = is_act(); break; - case EXIT_MASK: term_type = "Exited mask"; to_print = properties.mask.size(); break; - case ENTER_EXCLUDE: term_type = "Entered exclusion region"; to_print = properties.exclude.size(); break; - case TRAVERSE_ALL_INCLUDE: term_type = "Traversed all include regions"; to_print = stop_on_all_include; break; - } - if (to_print) - INFO (" " + term_type + ": " + str (100.0 * terminations[i] / (double)sum_terminations, 3) + "\%"); - } - - INFO ("Track rejection counts:"); - for (size_t i = 0; i != REJECTION_REASON_COUNT; ++i) { - std::string reject_type; - bool to_print = false; - switch (i) { - case INVALID_SEED: reject_type = "Invalid seed point"; to_print = true; break; - case NO_PROPAGATION_FROM_SEED: reject_type = "No propagation from seed"; to_print = true; break; - case TRACK_TOO_SHORT: reject_type = "Shorter than minimum length"; to_print = true; break; - case TRACK_TOO_LONG: reject_type = "Longer than maximum length"; to_print = is_act(); break; - case ENTER_EXCLUDE_REGION: reject_type = "Entered exclusion region"; to_print = properties.exclude.size(); break; - case MISSED_INCLUDE_REGION: reject_type = "Missed inclusion region"; to_print = properties.include.size(); break; - case ACT_POOR_TERMINATION: reject_type = "Poor structural termination"; to_print = is_act(); break; - case ACT_FAILED_WM_REQUIREMENT: reject_type = "Failed to traverse white matter"; to_print = is_act(); break; - } - if (to_print) - INFO (" " + reject_type + ": " + str (rejections[i])); - } + SharedBase (const std::string& diff_path, Properties& property_set); -#ifdef DEBUG_TERMINATIONS - for (size_t i = 0; i != TERMINATION_REASON_COUNT; ++i) { - delete debug_images[i]; - debug_images[i] = NULL; - } -#endif - - } + virtual ~SharedBase(); Image source; @@ -220,43 +69,12 @@ namespace MR const ACT::ACT_Shared_additions& act() const { return *act_shared_additions; } - float vox () const { return std::pow (source.spacing(0)*source.spacing(1)*source.spacing(2), float (1.0/3.0)); } - void set_step_size (float stepsize) - { - step_size = stepsize * vox(); - properties.set (step_size, "step_size"); - INFO ("step size = " + str (step_size) + " mm"); - - if (downsampler.get_ratio() > 1) - properties["output_step_size"] = str (step_size * downsampler.get_ratio()); - - float max_dist = 100.0 * vox(); - properties.set (max_dist, "max_dist"); - max_num_points = std::round (max_dist/step_size) + 1; - - float min_dist = is_act() ? (2.0 * vox()) : (5.0 * vox()); - properties.set (min_dist, "min_dist"); - min_num_points = std::max (2, int(std::round (min_dist/step_size) + 1)); - - max_angle = 90.0 * step_size / vox(); - properties.set (max_angle, "max_angle"); - INFO ("maximum deviation angle = " + str (max_angle) + " deg"); - max_angle *= Math::pi / 180.0; - cos_max_angle = std::cos (max_angle); - - if (rk4) { - max_angle_rk4 = max_angle; - cos_max_angle_rk4 = cos_max_angle; - max_angle = Math::pi; - cos_max_angle = 0.0; - } - } - + void set_step_size (float stepsize); // This gets overloaded for iFOD2, as each sample is output rather than just each step, and there are // multiple samples per step @@ -268,17 +86,7 @@ namespace MR #ifdef DEBUG_TERMINATIONS - void add_termination (const term_t i, const Eigen::Vector3f& p) const - { - terminations[i].fetch_add (1, std::memory_order_relaxed); - Image image (*debug_images[i]); - const auto pv = transform.scanner2voxel * p.cast(); - image.index(0) = ssize_t (std::round (pv[0])); - image.index(1) = ssize_t (std::round (pv[1])); - image.index(2) = ssize_t (std::round (pv[2])); - if (!is_out_of_bounds (image)) - image.value() += 1; - } + void add_termination (const term_t i, const Eigen::Vector3f& p) const; #endif @@ -294,9 +102,10 @@ namespace MR const Transform transform; #endif - }; + + } } } From 33d361f9ab18efa8ad6911bd7073001340299c94 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 25 Jul 2017 11:21:33 +1000 Subject: [PATCH 039/538] DWI apps: Fix -shells option --- src/dwi/shells.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dwi/shells.cpp b/src/dwi/shells.cpp index 8c65225ee1..8260f61385 100644 --- a/src/dwi/shells.cpp +++ b/src/dwi/shells.cpp @@ -96,7 +96,7 @@ namespace MR BitSet to_retain (count(), false); - auto opt = App::get_options ("shell"); + auto opt = App::get_options ("shells"); if (opt.size()) { vector desired_bvalues = opt[0][0]; @@ -204,7 +204,7 @@ namespace MR } throw Exception ("Unable to robustly select desired shell b=" + str(*b) + " (detected shells are: " + bvalues + ")"); } else { - WARN ("User requested shell b=" + str(*b) + "; have selected shell " + str(shells[best_shell].get_mean()) + " +- " + str(shells[best_shell].get_stdev())); + WARN ("User requested shell b=" + str(*b) + "; have selected nearby shell " + str(shells[best_shell].get_mean()) + " +- " + str(shells[best_shell].get_stdev())); if (!to_retain[best_shell]) { to_retain[best_shell] = true; nonbzero_selected_count++; @@ -235,7 +235,7 @@ namespace MR if (force_singleshell && !is_single_shell()) { if (count() == 1 && has_bzero()) throw Exception ("No non b=0 data found, but the command requires a non b=0 shell"); - WARN ("Multiple non-zero b-value shells detected; automatically selecting b=" + str(largest().get_mean()) + " with " + str(largest().count()) + " volumes"); + WARN ("Multiple non-zero b-value shells detected, automatically selecting largest b-value: b=" + str(largest().get_mean()) + " with " + str(largest().count()) + " volumes"); to_retain[count()-1] = true; if (has_bzero()) to_retain[0] = true; From 096520f37f54e24a7f8248a06ff1feea671a2062 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 25 Jul 2017 13:05:49 +1000 Subject: [PATCH 040/538] Slight modifications to shell handling - Fixed an additional error in dwi2response that was resulting in the -shells option not influencing the code path. - Renamed -shell option in dwi2response to -shells to match commands. - Renamed mrinfo's -shells option to -shellvalues, in order to prevent conflict with the functionality of that option in other commands and also to make it more clear what the option provides. --- bin/dwi2response | 18 +++++++++--------- bin/dwishellmath | 2 +- cmd/amp2response.cpp | 2 +- cmd/amp2sh.cpp | 2 +- cmd/dwi2fod.cpp | 2 +- cmd/dwi2noise.cpp | 2 +- cmd/dwiextract.cpp | 8 ++++---- cmd/mrinfo.cpp | 14 +++++++------- docs/reference/commands/mrinfo.rst | 2 +- docs/reference/scripts/dwi2response.rst | 14 +++++++------- lib/mrtrix3/dwi2response/dhollander.py | 4 ++-- lib/mrtrix3/dwi2response/fa.py | 2 +- lib/mrtrix3/dwi2response/manual.py | 4 ++-- lib/mrtrix3/dwi2response/msmt_5tt.py | 4 ++-- src/dwi/shells.cpp | 2 +- src/dwi/shells.h | 12 ++++++------ testing/data | 2 +- 17 files changed, 48 insertions(+), 48 deletions(-) diff --git a/bin/dwi2response b/bin/dwi2response index 5e5a490d58..8a6a79c359 100755 --- a/bin/dwi2response +++ b/bin/dwi2response @@ -23,7 +23,7 @@ app.cmdline.addDescription('Each algorithm available also has its own help page, # General options common_options = app.cmdline.add_argument_group('Options common to all dwi2response algorithms') -common_options.add_argument('-shell', help='The b-value shell(s) to use in response function estimation (single value for single-shell response, comma-separated list for multi-shell response)') +common_options.add_argument('-shells', help='The b-value shell(s) to use in response function estimation (single value for single-shell response, comma-separated list for multi-shell response)') common_options.add_argument('-lmax', help='The maximum harmonic degree(s) of response function estimation (single value for single-shell response, comma-separated list for multi-shell response)') common_options.add_argument('-mask', help='Provide an initial mask for response voxel selection') common_options.add_argument('-voxels', help='Output an image showing the final voxel selection(s)') @@ -58,15 +58,15 @@ if app.args.lmax: app.error('Parameter lmax must be a number') if alg.needsSingleShell() and not len(lmax) == 1: app.error('Can only specify a single lmax value for single-shell algorithms') -shell_option = '' -if app.args.shell: +shells_option = '' +if app.args.shells: try: - shell_values = [ int(x) for x in app.args.shell.split(',') ] + shells_values = [ int(x) for x in app.args.shells.split(',') ] except: - app.error('-shell option should provide a comma-separated list of b-values') - if alg.needsSingleShell() and not len(shell_values) == 1: + app.error('-shells option should provide a comma-separated list of b-values') + if alg.needsSingleShell() and not len(shells_values) == 1: app.error('Can only specify a single b-value shell for single-shell algorithms') - shell_option = ' -shell ' + app.args.shell + shells_option = ' -shells ' + app.args.shells singleshell_option = '' if alg.needsSingleShell(): singleshell_option = ' -singleshell -no_bzero' @@ -82,8 +82,8 @@ elif not image.headerField(path.fromUser(app.args.input, False), 'dwgrad'): app.makeTempDir() # Get standard input data into the temporary directory -if alg.needsSingleShell() or shell_option: - run.command('mrconvert ' + path.fromUser(app.args.input, True) + ' - -stride 0,0,0,1' + grad_import_option + ' | dwiextract - ' + path.toTemp('dwi.mif', True) + shell_option + singleshell_option) +if alg.needsSingleShell() or shells_option: + run.command('mrconvert ' + path.fromUser(app.args.input, True) + ' - -stride 0,0,0,1' + grad_import_option + ' | dwiextract - ' + path.toTemp('dwi.mif', True) + shells_option + singleshell_option) else: # Don't discard b=0 in multi-shell algorithms run.command('mrconvert ' + path.fromUser(app.args.input, True) + ' ' + path.toTemp('dwi.mif', True) + ' -stride 0,0,0,1' + grad_import_option) if app.args.mask: diff --git a/bin/dwishellmath b/bin/dwishellmath index 372cb50d2b..9bed453354 100755 --- a/bin/dwishellmath +++ b/bin/dwishellmath @@ -22,7 +22,7 @@ HELP_PAGE fi tmpfiles="" -for b in $(mrinfo "$1" -shells); +for b in $(mrinfo "$1" -shellvalues); do echo "Extracting $2 of the b=$b shell." tmpfiles="$tmpfiles "$(dwiextract -shell $b "$1" - -quiet | mrmath -axis 3 - $2 - -quiet) diff --git a/cmd/amp2response.cpp b/cmd/amp2response.cpp index 7ec15d2095..81c1e870b9 100644 --- a/cmd/amp2response.cpp +++ b/cmd/amp2response.cpp @@ -72,7 +72,7 @@ void usage () + Option ("directions", "provide an external text file containing the directions along which the amplitudes are sampled") + Argument("path").type_file_in() - + DWI::ShellOption + + DWI::ShellsOption + Option ("lmax", "specify the maximum harmonic degree of the response function to estimate " "(can be a comma-separated list for multi-shell data)") diff --git a/cmd/amp2sh.cpp b/cmd/amp2sh.cpp index 982e6e7885..de03828194 100644 --- a/cmd/amp2sh.cpp +++ b/cmd/amp2sh.cpp @@ -67,7 +67,7 @@ void usage () + Argument ("noise").type_image_in() + DWI::GradImportOptions() - + DWI::ShellOption + + DWI::ShellsOption + Stride::Options; } diff --git a/cmd/dwi2fod.cpp b/cmd/dwi2fod.cpp index 20d9ce1bbc..5bb9a1ab1b 100644 --- a/cmd/dwi2fod.cpp +++ b/cmd/dwi2fod.cpp @@ -90,7 +90,7 @@ void usage () OPTIONS + DWI::GradImportOptions() - + DWI::ShellOption + + DWI::ShellsOption + CommonOptions + DWI::SDeconv::CSD_options + Stride::Options; diff --git a/cmd/dwi2noise.cpp b/cmd/dwi2noise.cpp index c744bde862..1a0d416827 100644 --- a/cmd/dwi2noise.cpp +++ b/cmd/dwi2noise.cpp @@ -55,7 +55,7 @@ void usage () + Argument ("order").type_integer (0, 30) + DWI::GradImportOptions() - + DWI::ShellOption; + + DWI::ShellsOption; } diff --git a/cmd/dwiextract.cpp b/cmd/dwiextract.cpp index e0209461ae..5f74eb802c 100644 --- a/cmd/dwiextract.cpp +++ b/cmd/dwiextract.cpp @@ -42,13 +42,13 @@ void usage () + Option ("no_bzero", "Output only non b=0 volumes (default, if -singleshell is not specified).") + Option ("singleshell", "Force a single-shell (single non b=0 shell) output. This will include b=0 volumes, if present. Use with -bzero to enforce presence of b=0 volumes (error if not present) or with -no_bzero to exclude them.") + DWI::GradImportOptions() - + DWI::ShellOption + + DWI::ShellsOption + PhaseEncoding::ImportOptions + PhaseEncoding::SelectOptions + Stride::Options; } -void run() +void run() { auto input_header = Header::open (argument[0]); auto input_image = input_header.get_image(); @@ -61,12 +61,12 @@ void run() // of all dwis or all bzeros i.e. don't initialise the Shells class vector volumes; bool bzero = get_options ("bzero").size(); - if (get_options ("shell").size() || get_options ("singleshell").size()) { + if (get_options ("shells").size() || get_options ("singleshell").size()) { DWI::Shells shells (grad); shells.select_shells (get_options ("singleshell").size(),get_options ("bzero").size(),get_options ("no_bzero").size()); for (size_t s = 0; s != shells.count(); ++s) { DEBUG ("Including data from shell b=" + str(shells[s].get_mean()) + " +- " + str(shells[s].get_stdev())); - for (const auto v : shells[s].get_volumes()) + for (const auto v : shells[s].get_volumes()) volumes.push_back (v); } bzero = (shells.count() == 1 && shells.has_bzero()); diff --git a/cmd/mrinfo.cpp b/cmd/mrinfo.cpp index 23ef14d6eb..324b650c70 100644 --- a/cmd/mrinfo.cpp +++ b/cmd/mrinfo.cpp @@ -87,7 +87,7 @@ void usage () + GradExportOptions + Option ("dwgrad", "the diffusion-weighting gradient table, as stored in the header " "(i.e. without any interpretation, scaling of b-values, or normalisation of gradient vectors)") - + Option ("shells", "list the average b-value of each shell") + + Option ("shellvalues", "list the average b-value of each shell") + Option ("shellcounts", "list the number of volumes in each shell") + PhaseEncoding::ExportOptions @@ -133,10 +133,10 @@ void print_strides (const Header& header) std::cout << buffer << "\n"; } -void print_shells (const Header& header, const bool shells, const bool shellcounts) +void print_shells (const Header& header, const bool shellvalues, const bool shellcounts) { DWI::Shells dwshells (DWI::parse_DW_scheme (header)); - if (shells) { + if (shellvalues) { for (size_t i = 0; i < dwshells.count(); i++) std::cout << dwshells[i].get_mean() << " "; std::cout << "\n"; @@ -214,13 +214,13 @@ void run () const auto properties = get_options("property"); const bool transform = get_options("transform") .size(); const bool dwgrad = get_options("dwgrad") .size(); - const bool shells = get_options("shells") .size(); + const bool shellvalues = get_options("shellvalues") .size(); const bool shellcounts = get_options("shellcounts") .size(); const bool raw_dwgrad = get_options("raw_dwgrad") .size(); const bool petable = get_options("petable") .size(); const bool print_full_header = !(format || ndim || size || vox || datatype || stride || - offset || multiplier || properties.size() || transform || dwgrad || export_grad || shells || shellcounts || export_pe || petable); + offset || multiplier || properties.size() || transform || dwgrad || export_grad || shellvalues || shellcounts || export_pe || petable); Eigen::IOFormat fmt(Eigen::FullPrecision, 0, ", ", "\n", "", "", "", "\n"); @@ -228,7 +228,7 @@ void run () auto header = Header::open (argument[i]); if (raw_dwgrad) DWI::set_DW_scheme (header, DWI::get_DW_scheme (header)); - else if (export_grad || check_option_group (GradImportOptions) || dwgrad || shells || shellcounts) + else if (export_grad || check_option_group (GradImportOptions) || dwgrad || shellvalues || shellcounts) DWI::set_DW_scheme (header, DWI::get_valid_DW_scheme (header, true)); if (format) std::cout << header.format() << "\n"; @@ -241,7 +241,7 @@ void run () if (multiplier) std::cout << header.intensity_scale() << "\n"; if (transform) print_transform (header); if (dwgrad) std::cout << DWI::get_DW_scheme (header) << "\n"; - if (shells || shellcounts) print_shells (header, shells, shellcounts); + if (shellvalues || shellcounts) print_shells (header, shellvalues, shellcounts); if (petable) std::cout << PhaseEncoding::get_scheme (header) << "\n"; for (size_t n = 0; n < properties.size(); ++n) diff --git a/docs/reference/commands/mrinfo.rst b/docs/reference/commands/mrinfo.rst index 8180679d41..129174ef9a 100644 --- a/docs/reference/commands/mrinfo.rst +++ b/docs/reference/commands/mrinfo.rst @@ -75,7 +75,7 @@ DW gradient table export options - **-dwgrad** the diffusion-weighting gradient table, as stored in the header (i.e. without any interpretation, scaling of b-values, or normalisation of gradient vectors) -- **-shells** list the average b-value of each shell +- **-shellvalues** list the average b-value of each shell - **-shellcounts** list the number of volumes in each shell diff --git a/docs/reference/scripts/dwi2response.rst b/docs/reference/scripts/dwi2response.rst index ec588b75a6..282911b813 100644 --- a/docs/reference/scripts/dwi2response.rst +++ b/docs/reference/scripts/dwi2response.rst @@ -30,7 +30,7 @@ Options Options common to all dwi2response algorithms ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shell** The b-value shell(s) to use in response function estimation (single value for single-shell response, comma-separated list for multi-shell response) +- **-shells** The b-value shell(s) to use in response function estimation (single value for single-shell response, comma-separated list for multi-shell response) - **-lmax** The maximum harmonic degree(s) of response function estimation (single value for single-shell response, comma-separated list for multi-shell response) @@ -122,7 +122,7 @@ Options specific to the 'dhollander' algorithm Options common to all dwi2response algorithms ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shell** The b-value shell(s) to use in response function estimation (single value for single-shell response, comma-separated list for multi-shell response) +- **-shells** The b-value shell(s) to use in response function estimation (single value for single-shell response, comma-separated list for multi-shell response) - **-lmax** The maximum harmonic degree(s) of response function estimation (single value for single-shell response, comma-separated list for multi-shell response) @@ -213,7 +213,7 @@ Options specific to the 'fa' algorithm Options common to all dwi2response algorithms ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shell** The b-value shell(s) to use in response function estimation (single value for single-shell response, comma-separated list for multi-shell response) +- **-shells** The b-value shell(s) to use in response function estimation (single value for single-shell response, comma-separated list for multi-shell response) - **-lmax** The maximum harmonic degree(s) of response function estimation (single value for single-shell response, comma-separated list for multi-shell response) @@ -301,7 +301,7 @@ Options specific to the 'manual' algorithm Options common to all dwi2response algorithms ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shell** The b-value shell(s) to use in response function estimation (single value for single-shell response, comma-separated list for multi-shell response) +- **-shells** The b-value shell(s) to use in response function estimation (single value for single-shell response, comma-separated list for multi-shell response) - **-lmax** The maximum harmonic degree(s) of response function estimation (single value for single-shell response, comma-separated list for multi-shell response) @@ -392,7 +392,7 @@ Options specific to the 'msmt_5tt' algorithm Options common to all dwi2response algorithms ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shell** The b-value shell(s) to use in response function estimation (single value for single-shell response, comma-separated list for multi-shell response) +- **-shells** The b-value shell(s) to use in response function estimation (single value for single-shell response, comma-separated list for multi-shell response) - **-lmax** The maximum harmonic degree(s) of response function estimation (single value for single-shell response, comma-separated list for multi-shell response) @@ -483,7 +483,7 @@ Options specific to the 'tax' algorithm Options common to all dwi2response algorithms ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shell** The b-value shell(s) to use in response function estimation (single value for single-shell response, comma-separated list for multi-shell response) +- **-shells** The b-value shell(s) to use in response function estimation (single value for single-shell response, comma-separated list for multi-shell response) - **-lmax** The maximum harmonic degree(s) of response function estimation (single value for single-shell response, comma-separated list for multi-shell response) @@ -576,7 +576,7 @@ Options specific to the 'tournier' algorithm Options common to all dwi2response algorithms ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shell** The b-value shell(s) to use in response function estimation (single value for single-shell response, comma-separated list for multi-shell response) +- **-shells** The b-value shell(s) to use in response function estimation (single value for single-shell response, comma-separated list for multi-shell response) - **-lmax** The maximum harmonic degree(s) of response function estimation (single value for single-shell response, comma-separated list for multi-shell response) diff --git a/lib/mrtrix3/dwi2response/dhollander.py b/lib/mrtrix3/dwi2response/dhollander.py index 92254319c7..970b751019 100644 --- a/lib/mrtrix3/dwi2response/dhollander.py +++ b/lib/mrtrix3/dwi2response/dhollander.py @@ -41,7 +41,7 @@ def execute(): # Get b-values and number of volumes per b-value. - bvalues = [ int(round(float(x))) for x in image.headerField('dwi.mif', 'shells').split() ] + bvalues = [ int(round(float(x))) for x in image.headerField('dwi.mif', 'shellvalues').split() ] bvolumes = [ int(x) for x in image.headerField('dwi.mif', 'shellcounts').split() ] app.console(str(len(bvalues)) + ' unique b-value(s) detected: ' + ','.join(map(str,bvalues)) + ' with ' + ','.join(map(str,bvolumes)) + ' volumes.') if len(bvalues) < 2: @@ -167,7 +167,7 @@ def execute(): # Generate single-fibre WM, GM and CSF responses - bvalues_option = ' -shell ' + ','.join(map(str,bvalues)) + bvalues_option = ' -shells ' + ','.join(map(str,bvalues)) sfwm_lmax_option = '' if sfwm_lmax: sfwm_lmax_option = ' -lmax ' + ','.join(map(str,sfwm_lmax)) diff --git a/lib/mrtrix3/dwi2response/fa.py b/lib/mrtrix3/dwi2response/fa.py index b565f9f673..a893c2d154 100644 --- a/lib/mrtrix3/dwi2response/fa.py +++ b/lib/mrtrix3/dwi2response/fa.py @@ -32,7 +32,7 @@ def needsSingleShell(): def execute(): import os, shutil from mrtrix3 import app, image, path, run - bvalues = [ int(round(float(x))) for x in image.headerField('dwi.mif', 'shells').split() ] + bvalues = [ int(round(float(x))) for x in image.headerField('dwi.mif', 'shellvalues').split() ] if len(bvalues) < 2: app.error('Need at least 2 unique b-values (including b=0).') lmax_option = '' diff --git a/lib/mrtrix3/dwi2response/manual.py b/lib/mrtrix3/dwi2response/manual.py index 43c0ffd731..876c7460b4 100644 --- a/lib/mrtrix3/dwi2response/manual.py +++ b/lib/mrtrix3/dwi2response/manual.py @@ -38,7 +38,7 @@ def execute(): import os, shutil from mrtrix3 import app, image, path, run - shells = [ int(round(float(x))) for x in image.headerField('dwi.mif', 'shells').split() ] + shells = [ int(round(float(x))) for x in image.headerField('dwi.mif', 'shellvalues').split() ] # Get lmax information (if provided) lmax = [ ] @@ -57,7 +57,7 @@ def execute(): run.command('dwi2tensor dwi.mif - -mask in_voxels.mif | tensor2metric - -vector dirs.mif') # Get response function - bvalues_option = ' -shell ' + ','.join(map(str,shells)) + bvalues_option = ' -shells ' + ','.join(map(str,shells)) lmax_option = '' if lmax: lmax_option = ' -lmax ' + ','.join(map(str,lmax)) diff --git a/lib/mrtrix3/dwi2response/msmt_5tt.py b/lib/mrtrix3/dwi2response/msmt_5tt.py index ca6fd3cab5..634865dd4c 100644 --- a/lib/mrtrix3/dwi2response/msmt_5tt.py +++ b/lib/mrtrix3/dwi2response/msmt_5tt.py @@ -49,7 +49,7 @@ def execute(): run.command('5ttcheck 5tt.mif', False) # Get shell information - shells = [ int(round(float(x))) for x in image.headerField('dwi.mif', 'shells').split() ] + shells = [ int(round(float(x))) for x in image.headerField('dwi.mif', 'shellvalues').split() ] if len(shells) < 3: app.warn('Less than three b-value shells; response functions will not be applicable in resolving three tissues using MSMT-CSD algorithm') @@ -104,7 +104,7 @@ def execute(): app.error(message) # For each of the three tissues, generate a multi-shell response - bvalues_option = ' -shell ' + ','.join(map(str,shells)) + bvalues_option = ' -shells ' + ','.join(map(str,shells)) sfwm_lmax_option = '' if wm_lmax: sfwm_lmax_option = ' -lmax ' + ','.join(map(str,wm_lmax)) diff --git a/src/dwi/shells.cpp b/src/dwi/shells.cpp index 8260f61385..e4cfa7dcc1 100644 --- a/src/dwi/shells.cpp +++ b/src/dwi/shells.cpp @@ -24,7 +24,7 @@ namespace MR namespace DWI { - const App::OptionGroup ShellOption = App::OptionGroup ("DW shell selection options") + const App::OptionGroup ShellsOption = App::OptionGroup ("DW shell selection options") + App::Option ("shells", "specify one or more diffusion-weighted gradient shells to use during " "processing, as a comma-separated list of the desired approximate b-values. " diff --git a/src/dwi/shells.h b/src/dwi/shells.h index ba673cdbe2..7226b29702 100644 --- a/src/dwi/shells.h +++ b/src/dwi/shells.h @@ -54,7 +54,7 @@ namespace MR namespace DWI { - extern const App::OptionGroup ShellOption; + extern const App::OptionGroup ShellsOption; FORCE_INLINE default_type bzero_threshold () { static const default_type value = File::Config::get_float ("BZeroThreshold", 10.0); @@ -111,22 +111,22 @@ namespace MR const Shell& smallest() const { return shells.front(); } const Shell& largest() const { return shells.back(); } size_t count() const { return shells.size(); } - size_t volumecount() const { + size_t volumecount() const { size_t count = 0; for (const auto& it : shells) count += it.count(); return count; } - vector get_counts() const { - vector c (count()); + vector get_counts() const { + vector c (count()); for (size_t n = 0; n < count(); ++n) c[n] = shells[n].count(); return c; } - vector get_bvalues() const { - vector b (count()); + vector get_bvalues() const { + vector b (count()); for (size_t n = 0; n < count(); ++n) b[n] = shells[n].get_mean(); return b; diff --git a/testing/data b/testing/data index 24457b3a66..add3412305 160000 --- a/testing/data +++ b/testing/data @@ -1 +1 @@ -Subproject commit 24457b3a664e5aa3b9e24a1ecb6cf064f1754a3c +Subproject commit add34123053ec1ab5fb207f5225204c3eadf4e84 From f96bac098be12884f8dca66b734e4e75102c2318 Mon Sep 17 00:00:00 2001 From: Rami Tabbara Date: Thu, 27 Jul 2017 15:11:39 +1000 Subject: [PATCH 041/538] mrview: Tractography: Adding line and point geometry As requested in #708 --- .../mrview/tool/tractography/tractogram.cpp | 47 ++++++-- src/gui/mrview/tool/tractography/tractogram.h | 8 +- .../mrview/tool/tractography/tractography.cpp | 103 +++++++++++++++++- .../mrview/tool/tractography/tractography.h | 9 +- 4 files changed, 147 insertions(+), 20 deletions(-) diff --git a/src/gui/mrview/tool/tractography/tractogram.cpp b/src/gui/mrview/tool/tractography/tractogram.cpp index ddc58c7651..98861e102a 100644 --- a/src/gui/mrview/tool/tractography/tractogram.cpp +++ b/src/gui/mrview/tool/tractography/tractogram.cpp @@ -117,6 +117,9 @@ namespace MR std::string Tractogram::Shader::geometry_shader_source (const Displayable&) { + if (geometry_type != TrackGeometryType::Pseudotubes) + return std::string(); + std::string source = "layout(lines) in;\n" "layout(triangle_strip, max_vertices = 4) out;\n" @@ -208,6 +211,7 @@ namespace MR std::string Tractogram::Shader::fragment_shader_source (const Displayable& displayable) { const Tractogram& tractogram = dynamic_cast(displayable); + bool using_geom = geometry_type == TrackGeometryType::Pseudotubes; std::string source = "uniform float lower, upper;\n" @@ -218,35 +222,39 @@ namespace MR if (color_type == TrackColourType::ScalarFile || color_type == TrackColourType::Ends) source += "in vec3 fColour;\n"; if (use_lighting || color_type == TrackColourType::Direction) - source += "in vec3 g_tangent;\n"; + source += using_geom ? "in vec3 g_tangent;\n" : "in vec3 v_tangent;\n"; if (threshold_type != TrackThresholdType::None) - source += "in float g_amp;\n"; + source += using_geom ? "in float g_amp;\n" : "in vec3 v_amp;\n"; - if (use_lighting) + if (use_lighting && using_geom) source += "uniform float ambient, diffuse, specular, shine;\n" "uniform vec3 light_pos;\n" "in float g_height;\n"; if (do_crop_to_slab) - source += "in float g_include;\n"; + source += using_geom ? "in float g_include;\n" : "in float v_include;\n"; source += "void main() {\n"; if (do_crop_to_slab) - source += - " if (g_include < 0.0 || g_include > 1.0) discard;\n"; + source += using_geom ? + " if (g_include < 0.0 || g_include > 1.0) discard;\n" + : " if (v_include < 0.0 || v_include > 1.0) discard;\n"; if (threshold_type != TrackThresholdType::None) { if (tractogram.use_discard_lower()) - source += " if (g_amp < lower) discard;\n"; + source += using_geom ? " if (g_amp < lower) discard;\n" + : " if (v_amp < lower) discard;\n"; if (tractogram.use_discard_upper()) - source += " if (g_amp > upper) discard;\n"; + source += using_geom ? " if (g_amp > upper) discard;\n" + : " if (v_amp > upper) discard;\n"; } switch (color_type) { case TrackColourType::Direction: - source += " colour = abs (normalize (g_tangent));\n"; + source += using_geom ? " colour = abs (normalize (g_tangent));\n" + : " colour = abs (normalize (v_tangent));\n"; break; case TrackColourType::ScalarFile: source += " colour = fColour;\n"; @@ -258,7 +266,7 @@ namespace MR source += " colour = const_colour;\n"; } - if (use_lighting) + if (use_lighting && using_geom) // g_height tells us where we are across the cylinder (0 - PI) source += // compute surface normal: @@ -297,6 +305,8 @@ namespace MR return true; if (use_lighting != tractogram.tractography_tool.use_lighting) return true; + if (geometry_type != tractogram.geometry_type) + return true; return Displayable::Shader::need_update (object); } @@ -311,6 +321,7 @@ namespace MR use_lighting = tractogram.tractography_tool.use_lighting; color_type = tractogram.color_type; threshold_type = tractogram.threshold_type; + geometry_type = tractogram.geometry_type; Displayable::Shader::update (object); } @@ -330,6 +341,7 @@ namespace MR filename (filename), color_type (TrackColourType::Direction), threshold_type (TrackThresholdType::None), + geometry_type (TrackGeometryType::Line), sample_stride (0), vao_dirty (true), threshold_min (NaN), @@ -416,7 +428,9 @@ namespace MR original_fov = std::pow (dim[0]*dim[1]*dim[2], 1.0f/3.0f); } - line_thickness_screenspace = tractography_tool.line_thickness*original_fov*(transform.width()+transform.height()) / ( 2.0*window().FOV()*transform.width()*transform.height()); + line_thickness_screenspace = geometry_type != TrackGeometryType::Pseudotubes ? 1.f : + tractography_tool.line_thickness*original_fov*(transform.width()+transform.height()) / + ( 2.0*window().FOV()*transform.width()*transform.height()); gl::Uniform1f (gl::GetUniformLocation (track_shader, "line_thickness"), line_thickness_screenspace); gl::Uniform1f (gl::GetUniformLocation (track_shader, "scale_x"), transform.width()); @@ -501,7 +515,11 @@ namespace MR track_starts[buf][j] = (GLint) (std::ceil (original_track_starts[buf][j] / (float)sample_stride)) - 1; } } - gl::MultiDrawArrays (gl::LINE_STRIP, &track_starts[buf][0], &track_sizes[buf][0], num_tracks_per_buffer[buf]); + + if (geometry_type == TrackGeometryType::Points) + gl::MultiDrawArrays (gl::POINTS, &track_starts[buf][0], &track_sizes[buf][0], num_tracks_per_buffer[buf]); + else + gl::MultiDrawArrays (gl::LINE_STRIP, &track_starts[buf][0], &track_sizes[buf][0], num_tracks_per_buffer[buf]); } vao_dirty = false; @@ -868,6 +886,11 @@ namespace MR } + void Tractogram::set_geometry_type (const TrackGeometryType t) + { + geometry_type = t; + } + void Tractogram::load_tracks_onto_GPU (vector& buffer, vector& starts, diff --git a/src/gui/mrview/tool/tractography/tractogram.h b/src/gui/mrview/tool/tractography/tractogram.h index 733df94ca1..97a8030814 100644 --- a/src/gui/mrview/tool/tractography/tractogram.h +++ b/src/gui/mrview/tool/tractography/tractogram.h @@ -37,6 +37,7 @@ namespace MR enum class TrackColourType { Direction, Ends, Manual, ScalarFile }; enum class TrackThresholdType { None, UseColourFile, SeparateFile }; + enum class TrackGeometryType { Line, Pseudotubes, Points }; class Tractogram : public Displayable { MEMALIGN(Tractogram) @@ -67,8 +68,10 @@ namespace MR void set_color_type (const TrackColourType); void set_threshold_type (const TrackThresholdType); + void set_geometry_type (const TrackGeometryType); TrackColourType get_color_type() const { return color_type; } TrackThresholdType get_threshold_type() const { return threshold_type; } + TrackGeometryType get_geometry_type() const { return geometry_type; } void set_colour (float c[3]) { colour = { c[0], c[1], c[2] }; } @@ -98,7 +101,8 @@ namespace MR do_crop_to_slab (false), use_lighting (false), color_type (TrackColourType::Direction), - threshold_type (TrackThresholdType::None) { } + threshold_type (TrackThresholdType::None), + geometry_type (TrackGeometryType::Line) { } std::string vertex_shader_source (const Displayable&) override; std::string fragment_shader_source (const Displayable&) override; std::string geometry_shader_source (const Displayable&) override; @@ -108,6 +112,7 @@ namespace MR bool do_crop_to_slab, use_lighting; TrackColourType color_type; TrackThresholdType threshold_type; + TrackGeometryType geometry_type; } track_shader; @@ -122,6 +127,7 @@ namespace MR TrackColourType color_type; TrackThresholdType threshold_type; + TrackGeometryType geometry_type; // Instead of tracking the file path, pre-calculate the // streamline tangents and store them; then, if colour by diff --git a/src/gui/mrview/tool/tractography/tractography.cpp b/src/gui/mrview/tool/tractography/tractography.cpp index 1c8482350a..1a2d65947e 100644 --- a/src/gui/mrview/tool/tractography/tractography.cpp +++ b/src/gui/mrview/tool/tractography/tractography.cpp @@ -158,6 +158,22 @@ namespace MR main_box->addLayout (hlayout); + hlayout = new HBoxLayout; + hlayout->setContentsMargins (0, 0, 0, 0); + hlayout->setSpacing (0); + + hlayout->addWidget (new QLabel ("geometry")); + + geom_type_combobox = new ComboBoxWithErrorMsg (this, "(variable)"); + geom_type_combobox->setToolTip (tr ("Set the tractogram geometry type")); + geom_type_combobox->addItem ("Lines"); + geom_type_combobox->addItem ("Pseudotubes"); + geom_type_combobox->addItem ("Points"); + connect (geom_type_combobox, SIGNAL (activated(int)), this, SLOT (geom_type_selection_slot (int))); + hlayout->addWidget (geom_type_combobox); + + main_box->addLayout (hlayout); + scalar_file_options = new TrackScalarFileOptions (this); main_box->addWidget (scalar_file_options); @@ -179,7 +195,8 @@ namespace MR thickness_slider->setRange (-1000,1000); thickness_slider->setSliderPosition (0); connect (thickness_slider, SIGNAL (valueChanged (int)), this, SLOT (line_thickness_slot (int))); - general_opt_grid->addWidget (new QLabel ("line thickness"), 1, 0); + thickness_label = new QLabel ("thickness"); + general_opt_grid->addWidget (thickness_label, 1, 0); general_opt_grid->addWidget (thickness_slider, 1, 1); QGroupBox* slab_group_box = new QGroupBox (tr("crop to slab")); @@ -198,7 +215,7 @@ namespace MR connect (slab_entry, SIGNAL (valueChanged()), this, SLOT (on_slab_thickness_slot())); slab_layout->addWidget (slab_entry, 0, 1); - QGroupBox* lighting_group_box = new QGroupBox (tr("use lighting")); + lighting_group_box = new QGroupBox (tr("use lighting")); lighting_group_box->setCheckable (true); lighting_group_box->setChecked (false); general_opt_grid->addWidget (lighting_group_box, 5, 0, 1, 2); @@ -206,7 +223,7 @@ namespace MR connect (lighting_group_box, SIGNAL (clicked (bool)), this, SLOT (on_use_lighting_slot (bool))); VBoxLayout* lighting_layout = new VBoxLayout (lighting_group_box); - QPushButton* lighting_button = new QPushButton ("Track lighting..."); + lighting_button = new QPushButton ("Track lighting..."); lighting_button->setIcon (QIcon (":/light.svg")); connect (lighting_button, SIGNAL (clicked()), this, SLOT (on_lighting_settings())); lighting_layout->addWidget (lighting_button); @@ -236,6 +253,8 @@ namespace MR action = new QAction("&Colour by (track) scalar file", this); connect (action, SIGNAL(triggered()), this, SLOT (colour_by_scalar_file_slot())); track_option_menu->addAction (action); + + update_geometry_type_gui(); } @@ -559,7 +578,7 @@ namespace MR } - void Tractography::colour_mode_selection_slot (int /*unused*/) + void Tractography::colour_mode_selection_slot (int) { switch (colour_combobox->currentIndex()) { case 0: colour_track_by_direction_slot(); break; @@ -593,9 +612,37 @@ namespace MR } + + void Tractography::geom_type_selection_slot(int selected_index) + { + TrackGeometryType geom_type = TrackGeometryType::Line; + + switch (selected_index) { + case 1: + geom_type = TrackGeometryType::Pseudotubes; + break; + case 2: + geom_type = TrackGeometryType::Points; + default: + break; + } + + QModelIndexList indices = tractogram_list_view->selectionModel()->selectedIndexes(); + for (int i = 0; i < indices.size(); ++i) + tractogram_list_model->get_tractogram (indices[i])->set_geometry_type (geom_type); + + update_geometry_type_gui(); + + window().updateGL(); + } + + + void Tractography::selection_changed_slot (const QItemSelection &, const QItemSelection &) { update_scalar_options(); + update_geometry_type_gui(); + QModelIndexList indices = tractogram_list_view->selectionModel()->selectedIndexes(); if (!indices.size()) { colour_combobox->setEnabled (false); @@ -603,8 +650,11 @@ namespace MR return; } colour_combobox->setEnabled (true); - TrackColourType color_type = tractogram_list_model->get_tractogram (indices[0])->get_color_type(); - Eigen::Array3f color = tractogram_list_model->get_tractogram (indices[0])->colour; + + const Tractogram* first_tractogram = tractogram_list_model->get_tractogram (indices[0]); + + TrackColourType color_type = first_tractogram->get_color_type(); + Eigen::Array3f color = first_tractogram->colour; bool color_type_consistent = true; for (int i = 1; i != indices.size(); ++i) { const Tractogram* tractogram = tractogram_list_model->get_tractogram (indices[i]); @@ -639,6 +689,20 @@ namespace MR } else { colour_combobox->setError(); } + + TrackGeometryType geom_type = first_tractogram->get_geometry_type(); + int geom_combobox_index = 0; + switch (geom_type) { + case TrackGeometryType::Pseudotubes: + geom_combobox_index = 1; + break; + case TrackGeometryType::Points: + geom_combobox_index = 2; + break; + default: + break; + } + geom_type_combobox->setCurrentIndex(geom_combobox_index); } @@ -655,6 +719,33 @@ namespace MR + void Tractography::update_geometry_type_gui() + { + thickness_slider->setHidden (true); + thickness_label->setHidden (true); + lighting_button->setEnabled (false); + lighting_group_box->setEnabled (false); + geom_type_combobox->setEnabled (false); + + QModelIndexList indices = tractogram_list_view->selectionModel()->selectedIndexes(); + if (!indices.size()) + return; + + geom_type_combobox->setEnabled (true); + + const Tractogram* first_tractogram = tractogram_list_model->get_tractogram (indices[0]); + TrackGeometryType geom_type = first_tractogram->get_geometry_type(); + + if (geom_type == TrackGeometryType::Pseudotubes) { + thickness_slider->setHidden (false); + thickness_label->setHidden (false); + lighting_button->setEnabled (true); + lighting_group_box->setEnabled (true); + } + } + + + void Tractography::add_commandline_options (MR::App::OptionList& options) { diff --git a/src/gui/mrview/tool/tractography/tractography.h b/src/gui/mrview/tool/tractography/tractography.h index 8a7968b422..4dc345259c 100644 --- a/src/gui/mrview/tool/tractography/tractography.h +++ b/src/gui/mrview/tool/tractography/tractography.h @@ -89,6 +89,7 @@ namespace MR void colour_by_scalar_file_slot (); void colour_mode_selection_slot (int); void colour_button_slot(); + void geom_type_selection_slot (int); void selection_changed_slot (const QItemSelection &, const QItemSelection &); protected: @@ -98,15 +99,21 @@ namespace MR ComboBoxWithErrorMsg *colour_combobox; QColorButton *colour_button; + ComboBoxWithErrorMsg *geom_type_combobox; + TrackScalarFileOptions *scalar_file_options; LightingDock *lighting_dock; + QGroupBox* lighting_group_box; + QPushButton* lighting_button; + QSlider* opacity_slider; QSlider* thickness_slider; + QLabel* thickness_label; void dropEvent (QDropEvent* event) override; void update_scalar_options(); - + void update_geometry_type_gui(); }; } } From 9afe9711642d38033fa67c80caa0af6bc3d03f23 Mon Sep 17 00:00:00 2001 From: Rami Tabbara Date: Thu, 27 Jul 2017 16:25:47 +1000 Subject: [PATCH 042/538] mrview: Tractography: Fix endpoint/trackfile colouring when rendering lines/points --- src/gui/mrview/tool/tractography/tractogram.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/mrview/tool/tractography/tractogram.cpp b/src/gui/mrview/tool/tractography/tractogram.cpp index 98861e102a..a5a3e203c7 100644 --- a/src/gui/mrview/tool/tractography/tractogram.cpp +++ b/src/gui/mrview/tool/tractography/tractogram.cpp @@ -220,7 +220,7 @@ namespace MR "out vec3 colour;\n"; if (color_type == TrackColourType::ScalarFile || color_type == TrackColourType::Ends) - source += "in vec3 fColour;\n"; + source += using_geom ? "in vec3 fColour;\n" : "in vec3 v_colour;\n"; if (use_lighting || color_type == TrackColourType::Direction) source += using_geom ? "in vec3 g_tangent;\n" : "in vec3 v_tangent;\n"; @@ -257,10 +257,12 @@ namespace MR : " colour = abs (normalize (v_tangent));\n"; break; case TrackColourType::ScalarFile: - source += " colour = fColour;\n"; + source += using_geom ? " colour = fColour;\n" + : " colour = v_colour;\n"; break; case TrackColourType::Ends: - source += " colour = fColour;\n"; + source += using_geom ? " colour = fColour;\n" + : " colour = v_colour;\n"; break; case TrackColourType::Manual: source += " colour = const_colour;\n"; From 33a3f91f26e4ec696cc0c342097520b58af4028f Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 27 Jul 2017 23:38:31 +1000 Subject: [PATCH 043/538] tckmap & tckdynamicmap: Bug fixes from TWDFC porting --- cmd/tckdynamicmap.cpp | 2 +- cmd/tckmap.cpp | 4 +- core/fixel/legacy/image.h | 2 +- src/dwi/tractography/mapping/mapper.cpp | 2 +- src/dwi/tractography/mapping/mapper.h | 65 +++++++++---------- .../tractography/mapping/mapper_plugins.cpp | 6 +- src/dwi/tractography/mapping/mapper_plugins.h | 29 ++++++++- 7 files changed, 65 insertions(+), 45 deletions(-) diff --git a/cmd/tckdynamicmap.cpp b/cmd/tckdynamicmap.cpp index 80e01d1e09..4925f75d64 100644 --- a/cmd/tckdynamicmap.cpp +++ b/cmd/tckdynamicmap.cpp @@ -326,7 +326,7 @@ void run () { if (stat_vox == V_MEAN) { counts = Image::scratch (H_3D, "Track count scratch buffer"); Tractography::Reader tck_file (tck_path, properties); - Mapping::TrackLoader loader (tck_file, num_tracks, "Calculating initial TDI... "); + Mapping::TrackLoader loader (tck_file, num_tracks, "Calculating initial TDI"); Mapping::TrackMapperBase mapper (H_3D); mapper.set_upsample_ratio (upsample_ratio); Count_receiver receiver (counts); diff --git a/cmd/tckmap.cpp b/cmd/tckmap.cpp index a817182087..04309916d8 100644 --- a/cmd/tckmap.cpp +++ b/cmd/tckmap.cpp @@ -168,7 +168,7 @@ DESCRIPTION "results to a .mif file or .mih / .dat file pair - this will avoid the allocation " "of an additional buffer to store the output for write-out."; -REFERENCES +REFERENCES + "* For TDI or DEC TDI:\n" "Calamante, F.; Tournier, J.-D.; Jackson, G. D. & Connelly, A. " // Internal "Track-density imaging (TDI): Super-resolution white matter imaging using whole-brain track-density mapping. " @@ -188,7 +188,7 @@ REFERENCES "Pannek, K., Raffelt, D., Salvado, O., Rose, S. " // Internal "Incorporating directional information in diffusion tractography derived maps: angular track imaging (ATI). " "In Proc. ISMRM, 2012, 20, 1912" - + + "* If using -tod option:\n" "Dhollander, T., Emsell, L., Van Hecke, W., Maes, F., Sunaert, S., Suetens, P. " // Internal "Track Orientation Density Imaging (TODI) and Track Orientation Distribution (TOD) based tractography. " diff --git a/core/fixel/legacy/image.h b/core/fixel/legacy/image.h index 3c25bc1e59..6c63cdc9fd 100644 --- a/core/fixel/legacy/image.h +++ b/core/fixel/legacy/image.h @@ -73,7 +73,7 @@ namespace MR friend std::ostream& operator<< (std::ostream& stream, const Value& value) { stream << "Position [ "; for (size_t n = 0; n < value.offsets.ndim(); ++n) - stream << value.offsets[n] << " "; + stream << value.offsets.index(n) << " "; stream << "], offset = " << value.offsets.value() << ", " << value.size() << " elements"; return stream; } diff --git a/src/dwi/tractography/mapping/mapper.cpp b/src/dwi/tractography/mapping/mapper.cpp index 3cd0e34c03..b4cfbad5a4 100644 --- a/src/dwi/tractography/mapping/mapper.cpp +++ b/src/dwi/tractography/mapping/mapper.cpp @@ -61,7 +61,7 @@ void TrackMapperTWI::set_factor (const Streamline<>& tck, SetVoxelExtras& out) c case T_SUM: out.factor = 0.0; - for (const auto& i : factors) + for (const auto& i : factors) if (std::isfinite (i)) out.factor += i; break; diff --git a/src/dwi/tractography/mapping/mapper.h b/src/dwi/tractography/mapping/mapper.h index aea18864a2..41d413f26d 100644 --- a/src/dwi/tractography/mapping/mapper.h +++ b/src/dwi/tractography/mapping/mapper.h @@ -57,23 +57,23 @@ namespace MR { public: template - TrackMapperBase (const HeaderType& template_image) : - info (template_image), + TrackMapperBase (const HeaderType& template_image) : + info (template_image), scanner2voxel (Transform(template_image).scanner2voxel.cast()), - map_zero (false), - precise (false), - ends_only (false), - upsampler (1) { } + map_zero (false), + precise (false), + ends_only (false), + upsampler (1) { } template - TrackMapperBase (const HeaderType& template_image, const DWI::Directions::FastLookupSet& dirs) : - info (template_image), + TrackMapperBase (const HeaderType& template_image, const DWI::Directions::FastLookupSet& dirs) : + info (template_image), scanner2voxel (Transform(template_image).scanner2voxel.cast()), - map_zero (false), - precise (false), - ends_only (false), - dixel_plugin (new DixelMappingPlugin (dirs)), - upsampler (1) { } + map_zero (false), + precise (false), + ends_only (false), + dixel_plugin (new DixelMappingPlugin (dirs)), + upsampler (1) { } TrackMapperBase (const TrackMapperBase&) = default; TrackMapperBase (TrackMapperBase&&) = default; @@ -85,12 +85,12 @@ namespace MR { void set_upsample_ratio (const size_t i) { upsampler.set_ratio (i); } void set_map_zero (const bool i) { map_zero = i; } void set_use_precise_mapping (const bool i) { - if (i && ends_only) + if (i && ends_only) throw Exception ("Cannot do precise mapping and endpoint mapping together"); precise = i; } void set_map_ends_only (const bool i) { - if (i && precise) + if (i && precise) throw Exception ("Cannot do precise mapping and endpoint mapping together"); ends_only = i; } @@ -197,7 +197,7 @@ namespace MR { add_to_set (output, vox, dir, 1.0); } - for (auto& i : output) + for (auto& i : output) i.normalize(); } @@ -247,7 +247,7 @@ namespace MR { if (p == tck.size()) { p_voxel_exit = tck.back(); end_track = true; - } + } else { default_type mu_min = mu; @@ -351,31 +351,26 @@ namespace MR { { MEMALIGN(TrackMapperTWI) public: template - TrackMapperTWI (const HeaderType& template_image, const contrast_t c, const tck_stat_t s) : - TrackMapperBase (template_image), - contrast (c), - track_statistic (s) { } + TrackMapperTWI (const HeaderType& template_image, const contrast_t c, const tck_stat_t s) : + TrackMapperBase (template_image), + contrast (c), + track_statistic (s) { } TrackMapperTWI (const TrackMapperTWI& that) : - TrackMapperBase (static_cast (that)), - contrast (that.contrast), - track_statistic (that.track_statistic), - vector_data (that.vector_data) { - if (that.image_plugin) { - if (contrast == SCALAR_MAP || contrast == SCALAR_MAP_COUNT) - image_plugin.reset (new TWIScalarImagePlugin (*dynamic_cast (that.image_plugin.get()))); - else if (contrast == FOD_AMP) - image_plugin.reset (new TWIFODImagePlugin (*dynamic_cast (that.image_plugin.get()))); - else - throw Exception ("Copy-constructing TrackMapperTWI with unknown image plugin"); - } - } + TrackMapperBase (static_cast (that)), + contrast (that.contrast), + track_statistic (that.track_statistic), + vector_data (that.vector_data) + { + if (that.image_plugin) + image_plugin.reset (that.image_plugin->clone()); + } void add_scalar_image (const std::string&); void set_backtrack(); void add_fod_image (const std::string&); - void add_twdfc_image (Image&, const vector&, const ssize_t); + void add_twdfc_image (Image&, const vector&, const ssize_t); void add_vector_data (const std::string&); diff --git a/src/dwi/tractography/mapping/mapper_plugins.cpp b/src/dwi/tractography/mapping/mapper_plugins.cpp index 9913cd4e7a..d552c77e70 100644 --- a/src/dwi/tractography/mapping/mapper_plugins.cpp +++ b/src/dwi/tractography/mapping/mapper_plugins.cpp @@ -84,7 +84,7 @@ namespace MR { } } else { - if (interp.scanner (tck[index])) + if (!interp.scanner (tck[index])) return -1; } return index; @@ -129,7 +129,7 @@ namespace MR { factors.assign (1, NaN); vector values[2]; for (size_t tck_end_index = 0; tck_end_index != 2; ++tck_end_index) { - const ssize_t index = get_end_index (tck, tck_end_index); + const ssize_t index = get_end_index (tck, bool(tck_end_index)); if (index < 0) return; if (!interp.scanner (tck[index])) @@ -150,7 +150,7 @@ namespace MR { default_type product = 0.0; default_type variances[2] = { 0.0, 0.0 }; for (ssize_t i = 0; i != interp.size(3); ++i) { - product += ((values[0][i] - means[0]) * (values[1][i] - means[i])); + product += ((values[0][i] - means[0]) * (values[1][i] - means[1])); variances[0] += Math::pow2 (values[0][i] - means[0]); variances[1] += Math::pow2 (values[1][i] - means[1]); } diff --git a/src/dwi/tractography/mapping/mapper_plugins.h b/src/dwi/tractography/mapping/mapper_plugins.h index f8f90877a6..c7503312ff 100644 --- a/src/dwi/tractography/mapping/mapper_plugins.h +++ b/src/dwi/tractography/mapping/mapper_plugins.h @@ -79,10 +79,16 @@ namespace MR { interp (input_image), backtrack (false) { } - TWIImagePluginBase (const TWIImagePluginBase& that) = default; + TWIImagePluginBase (const TWIImagePluginBase& that) : + statistic (that.statistic), + interp (that.interp), + backtrack (that.backtrack), + backtrack_mask (that.backtrack_mask) { } virtual ~TWIImagePluginBase() { } + virtual TWIImagePluginBase* clone() const = 0; + void set_backtrack(); virtual void load_factors (const Streamline<>&, vector&) const = 0; @@ -127,12 +133,17 @@ namespace MR { } TWIScalarImagePlugin (const TWIScalarImagePlugin& that) : - TWIImagePluginBase (that) + TWIImagePluginBase (that) { if (interp.ndim() == 4) interp.index(3) = 0; } + TWIScalarImagePlugin* clone() const override + { + return new TWIScalarImagePlugin (*this); + } + void load_factors (const Streamline<>&, vector&) const override; }; @@ -153,6 +164,13 @@ namespace MR { precomputer->init (Math::SH::LforN (sh_coeffs.size())); } + TWIFODImagePlugin (const TWIFODImagePlugin& that) = default; + + TWIFODImagePlugin* clone() const override + { + return new TWIFODImagePlugin (*this); + } + void load_factors (const Streamline<>&, vector&) const override; private: @@ -172,6 +190,13 @@ namespace MR { kernel_centre ((kernel.size()-1) / 2), sample_centre (timepoint) { } + TWDFCImagePlugin (const TWDFCImagePlugin& that) = default; + + TWDFCImagePlugin* clone() const override + { + return new TWDFCImagePlugin (*this); + } + void load_factors (const Streamline<>&, vector&) const override; protected: From b64c14067f848b49049431e95a2a04e9cd36f68b Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Sat, 29 Jul 2017 22:08:18 +1000 Subject: [PATCH 044/538] app.progressBar: Fix missing import --- lib/mrtrix3/app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index a90de64379..1ef38ba598 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -781,6 +781,7 @@ def _printUsageRst(self): class progressBar: def _update(self): + import sys global clearLine, colourConsole, colourClear sys.stderr.write('\r' + colourConsole + os.path.basename(sys.argv[0]) + ': ' + colourClear + '[{0:>3}%] '.format(int(round(100.0*self.counter/self.target))) + self.message + '...' + clearLine + self.newline) sys.stderr.flush() @@ -802,6 +803,7 @@ def increment(self, msg=''): self._update() def done(self): + import sys global _verbosity global clearLine, colourConsole, colourClear self.counter = self.target From 7dfaab1889b2fa62c70ee555f97f18df01157314 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Sat, 29 Jul 2017 22:39:18 +1000 Subject: [PATCH 045/538] app.progressBar: Fix missing import (again) --- lib/mrtrix3/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index 1ef38ba598..ab85c4f9c4 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -781,7 +781,7 @@ def _printUsageRst(self): class progressBar: def _update(self): - import sys + import os, sys global clearLine, colourConsole, colourClear sys.stderr.write('\r' + colourConsole + os.path.basename(sys.argv[0]) + ': ' + colourClear + '[{0:>3}%] '.format(int(round(100.0*self.counter/self.target))) + self.message + '...' + clearLine + self.newline) sys.stderr.flush() @@ -803,7 +803,7 @@ def increment(self, msg=''): self._update() def done(self): - import sys + import os, sys global _verbosity global clearLine, colourConsole, colourClear self.counter = self.target From 999cfdd9ef61bd1a9ef333029440495c06e8f72e Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Sat, 29 Jul 2017 23:17:46 +1000 Subject: [PATCH 046/538] app.progressBar: Colouring more consistent --- lib/mrtrix3/app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index ab85c4f9c4..d4476f1d0c 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -782,8 +782,8 @@ class progressBar: def _update(self): import os, sys - global clearLine, colourConsole, colourClear - sys.stderr.write('\r' + colourConsole + os.path.basename(sys.argv[0]) + ': ' + colourClear + '[{0:>3}%] '.format(int(round(100.0*self.counter/self.target))) + self.message + '...' + clearLine + self.newline) + global clearLine, colourConsole, colourClear, colourExec + sys.stderr.write('\r' + os.path.basename(sys.argv[0]) + ': ' + colourExec + '[{0:>3}%] '.format(int(round(100.0*self.counter/self.target))) + colourConsole + self.message + '...' + colourClear + clearLine + self.newline) sys.stderr.flush() def __init__(self, msg, target): @@ -805,9 +805,9 @@ def increment(self, msg=''): def done(self): import os, sys global _verbosity - global clearLine, colourConsole, colourClear + global clearLine, colourConsole, colourClear, colourExec self.counter = self.target - sys.stderr.write('\r' + colourConsole + os.path.basename(sys.argv[0]) + ': ' + colourClear + '[100%] ' + self.message + clearLine + '\n') + sys.stderr.write('\r' + os.path.basename(sys.argv[0]) + ': ' + colourExec + '[100%] ' + colourConsole + self.message + colourClear + clearLine + '\n') sys.stderr.flush() _verbosity = self.orig_verbosity From a50fcae1d98acbbe7237821cf4f0a2d957863885 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 31 Jul 2017 09:59:59 +1000 Subject: [PATCH 047/538] Scripts: Minor fix to __print_usage_markdown__ --- lib/mrtrix3/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index d4476f1d0c..5dc7b80a95 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -668,7 +668,7 @@ def _printUsageMarkdown(self): text += ' '.join(option.metavar) else: text += option.metavar - print ('+ **-' + text + '**
' + option.help) + print ('+ **' + text + '**
' + option.help) print ('') if self._citationList: print ('## References') From 7bc37a0c1a954fd8f613cc693eaba31549779fff Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 31 Jul 2017 10:58:20 +1000 Subject: [PATCH 048/538] Add references to TW-dFC article, & update docs. --- cmd/tckdynamicmap.cpp | 10 +-- cmd/tckmap.cpp | 5 ++ docs/reference/commands/tckdynamicmap.rst | 86 +++++++++++++++++++++++ docs/reference/commands/tckmap.rst | 6 +- docs/reference/commands_list.rst | 6 +- 5 files changed, 105 insertions(+), 8 deletions(-) create mode 100644 docs/reference/commands/tckdynamicmap.rst diff --git a/cmd/tckdynamicmap.cpp b/cmd/tckdynamicmap.cpp index 4925f75d64..98ab853740 100644 --- a/cmd/tckdynamicmap.cpp +++ b/cmd/tckdynamicmap.cpp @@ -99,6 +99,11 @@ OPTIONS "(if omitted, an appropriate ratio will be determined automatically)") + Argument ("factor").type_integer (1); + REFERENCES + + "Calamante, F.; Smith, R.E.; Liang, X.; Zalesky, A.; Connelly, A " // Internal + "Track-weighted dynamic functional connectivity (TW-dFC): a new method to study time-resolved functional connectivity. " + "Brain Struct Funct, 2017, doi: 10.1007/s00429-017-1431-1"; + } @@ -209,11 +214,6 @@ void run () { Tractography::Reader tck_file (tck_path, properties); } const size_t num_tracks = properties["count"].empty() ? 0 : to (properties["count"]); - float step_size = 0.0; - if (properties.find ("output_step_size") != properties.end()) - step_size = to (properties["output_step_size"]); - else - step_size = to (properties["step_size"]); Image fmri_image (Image::open (argument[1]).with_direct_io(3)); diff --git a/cmd/tckmap.cpp b/cmd/tckmap.cpp index 04309916d8..61bb6da6b4 100644 --- a/cmd/tckmap.cpp +++ b/cmd/tckmap.cpp @@ -194,6 +194,11 @@ REFERENCES "Track Orientation Density Imaging (TODI) and Track Orientation Distribution (TOD) based tractography. " "NeuroImage, 2014, 94, 312-336" + + "* If using -contrast scalar_map and -stat_tck ends_corr:\n" + "Calamante, F.; Smith, R.E.; Liang, X.; Zalesky, A.; Connelly, A " // Internal + "Track-weighted dynamic functional connectivity (TW-dFC): a new method to study time-resolved functional connectivity. " + "Brain Struct Funct, 2017, doi: 10.1007/s00429-017-1431-1" + + "* If using other contrasts / statistics:\n" "Calamante, F.; Tournier, J.-D.; Smith, R. E. & Connelly, A. " // Internal "A generalised framework for super-resolution track-weighted imaging. " diff --git a/docs/reference/commands/tckdynamicmap.rst b/docs/reference/commands/tckdynamicmap.rst new file mode 100644 index 0000000000..10f763769b --- /dev/null +++ b/docs/reference/commands/tckdynamicmap.rst @@ -0,0 +1,86 @@ +.. _tckdynamicmap: + +tckdynamicmap +=================== + +Synopsis +-------- + +Perform the Track-Weighted Dynamic Functional Connectivity (TW-dFC) method. + +Usage +-------- + +:: + + tckdynamicmap [ options ] tracks fmri output + +- *tracks*: the input track file. +- *fmri*: the pre-processed fMRI time series +- *output*: the output TW-dFC image + +Description +----------- + +This command generates a sliding-window Track-Weighted Image (TWI), where the contribution from each streamline to the image at each timepoint is the Pearson correlation between the fMRI time series at the streamline endpoints, within a sliding temporal window centred at that timepoint. + +Options +------- + +- **-template image** an image file to be used as a template for the output (the output image will have the same transform and field of view). + +- **-vox size** provide either an isotropic voxel size (in mm), or comma-separated list of 3 voxel dimensions. + +- **-stat_vox type** define the statistic for choosing the final voxel intensities for a given contrast type given the individual values from the tracks passing through each voxelOptions are: sum, min, mean, max (default: mean) + +- **-window_shape shape** specify the shape of the sliding window weighting function. Options are: rectangle, triangle, cosine, hann, hamming, lanczos (default = rectangle) + +- **-window_width value** set the full width of the sliding window (in volumes, not time) (must be an odd number) (default = 15) + +- **-backtrack** if no valid timeseries is found at the streamline endpoint, backtrack along the streamline trajectory until a valid timeseries is found + +- **-upsample factor** upsample the tracks by some ratio using Hermite interpolation before mappipng (if omitted, an appropriate ratio will be determined automatically) + +Standard options +^^^^^^^^^^^^^^^^ + +- **-info** display information messages. + +- **-quiet** do not display information messages or progress status. + +- **-debug** display debugging messages. + +- **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. + +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) + +- **-failonwarn** terminate program if a warning is produced + +- **-help** display this information page and exit. + +- **-version** display version information and exit. + +References +^^^^^^^^^^ + +Calamante, F.; Smith, R.E.; Liang, X.; Zalesky, A.; Connelly, A Track-weighted dynamic functional connectivity (TW-dFC): a new method to study time-resolved functional connectivity. Brain Struct Funct, 2017, doi: 10.1007/s00429-017-1431-1 + +-------------- + + + +**Author:** Robert E. Smith (robert.smith@florey.edu.au) + +**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. + +This Source Code Form is subject to the terms of the Mozilla Public +License, v. 2.0. If a copy of the MPL was not distributed with this +file, you can obtain one at http://mozilla.org/MPL/2.0/. + +MRtrix is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty +of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +For more details, see http://www.mrtrix.org/. + + diff --git a/docs/reference/commands/tckmap.rst b/docs/reference/commands/tckmap.rst index c7fcda461c..7fd19fe0e1 100644 --- a/docs/reference/commands/tckmap.rst +++ b/docs/reference/commands/tckmap.rst @@ -55,12 +55,14 @@ Options for the TWI image contrast properties - **-stat_vox type** define the statistic for choosing the final voxel intensities for a given contrast type given the individual values from the tracks passing through each voxel. Options are: sum, min, mean, max (default: sum) -- **-stat_tck type** define the statistic for choosing the contribution to be made by each streamline as a function of the samples taken along their lengths. Only has an effect for 'scalar_map', 'fod_amp' and 'curvature' contrast types. Options are: sum, min, mean, max, median, mean_nonzero, gaussian, ends_min, ends_mean, ends_max, ends_prod (default: mean) +- **-stat_tck type** define the statistic for choosing the contribution to be made by each streamline as a function of the samples taken along their lengths. Only has an effect for 'scalar_map', 'fod_amp' and 'curvature' contrast types. Options are: sum, min, mean, max, median, mean_nonzero, gaussian, ends_min, ends_mean, ends_max, ends_prod, ends_corr (default: mean) - **-fwhm_tck value** when using gaussian-smoothed per-track statistic, specify the desired full-width half-maximum of the Gaussian smoothing kernel (in mm) - **-map_zero** if a streamline has zero contribution based on the contrast & statistic, typically it is not mapped; use this option to still contribute to the map even if this is the case (these non-contributing voxels can then influence the mean value in each voxel of the map) +- **-backtrack** when using -stat_tck ends_*, if the streamline endpoint is outside the FoV, backtrack along the streamline trajectory until an appropriate point is found (note: with -stat_tck ends_corr, this will also look for a valid time-series) + Options for the streamline-to-voxel mapping mechanism ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -104,6 +106,8 @@ References * If using -tod option:Dhollander, T., Emsell, L., Van Hecke, W., Maes, F., Sunaert, S., Suetens, P. Track Orientation Density Imaging (TODI) and Track Orientation Distribution (TOD) based tractography. NeuroImage, 2014, 94, 312-336 +* If using -contrast scalar_map and -stat_tck ends_corr:Calamante, F.; Smith, R.E.; Liang, X.; Zalesky, A.; Connelly, A Track-weighted dynamic functional connectivity (TW-dFC): a new method to study time-resolved functional connectivity. Brain Struct Funct, 2017, doi: 10.1007/s00429-017-1431-1 + * If using other contrasts / statistics:Calamante, F.; Tournier, J.-D.; Smith, R. E. & Connelly, A. A generalised framework for super-resolution track-weighted imaging. NeuroImage, 2012, 59, 2494-2503 * If using -precise mapping option:Smith, R. E.; Tournier, J.-D.; Calamante, F. & Connelly, A. SIFT: Spherical-deconvolution informed filtering of tractograms. NeuroImage, 2013, 67, 298-312 (Appendix 3) diff --git a/docs/reference/commands_list.rst b/docs/reference/commands_list.rst index e2dda2196c..dca49571d1 100644 --- a/docs/reference/commands_list.rst +++ b/docs/reference/commands_list.rst @@ -91,6 +91,7 @@ List of MRtrix3 commands commands/tck2connectome commands/tck2fixel commands/tckconvert + commands/tckdynamicmap commands/tckedit commands/tckgen commands/tckglobal @@ -99,8 +100,8 @@ List of MRtrix3 commands commands/tcknormalise commands/tckresample commands/tcksample - commands/tcksift2 commands/tcksift + commands/tcksift2 commands/tckstats commands/tensor2metric commands/transformcalc @@ -202,6 +203,7 @@ List of MRtrix3 commands :ref:`tck2connectome`, "Generate a connectome matrix from a streamlines file and a node parcellation image" :ref:`tck2fixel`, "Compute a fixel TDI map from a tractogram" :ref:`tckconvert`, "Convert between different track file formats" + :ref:`tckdynamicmap`, "Perform the Track-Weighted Dynamic Functional Connectivity (TW-dFC) method." :ref:`tckedit`, "Perform various editing operations on track files" :ref:`tckgen`, "Perform streamlines tractography" :ref:`tckglobal`, "Multi-Shell Multi-Tissue Global Tractography" @@ -210,8 +212,8 @@ List of MRtrix3 commands :ref:`tcknormalise`, "Apply a normalisation map to a tracks file" :ref:`tckresample`, "Resample each streamline in a track file to a new set of vertices" :ref:`tcksample`, "Sample values of an associated image along tracks" - :ref:`tcksift2`, "Successor to the SIFT method; instead of removing streamlines, use an EM framework to find an appropriate cross-section multiplier for each streamline" :ref:`tcksift`, "Filter a whole-brain fibre-tracking data set such that the streamline densities match the FOD lobe integrals" + :ref:`tcksift2`, "Successor to the SIFT method; instead of removing streamlines, use an EM framework to find an appropriate cross-section multiplier for each streamline" :ref:`tckstats`, "Calculate statistics on streamlines length" :ref:`tensor2metric`, "Generate maps of tensor-derived parameters" :ref:`transformcalc`, "Perform calculations on linear transformation matrices" From ed1057a13ae51f53bf549da78906a6fc8f02ae3f Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 31 Jul 2017 14:48:08 +1000 Subject: [PATCH 049/538] TW-dFC changes - Command tckdynamicmap has been renamed to tckdfc. This is partly for compatibility with supporting the generation of "static" TW-dFC images, and partly for compatibility with predicted future changes to arrangement of other commands. - Generation of "static" TW-dFC images has been removed from tckmap (previously achieved using -contrast scalar_map -stat_tck ends_corr), and added to the tckdfc command using the -static option. - When generating "dynamic" TW-dFC images, it is now compulsory to provide sliding time-window shape and width using the -dynamic option. --- cmd/{tckdynamicmap.cpp => tckdfc.cpp} | 223 +++++++++++------- .../{tckdynamicmap.rst => tckdfc.rst} | 29 ++- docs/reference/commands/tckmap.rst | 2 +- docs/reference/commands_list.rst | 4 +- src/dwi/tractography/mapping/mapper.cpp | 15 +- src/dwi/tractography/mapping/mapper.h | 3 +- .../tractography/mapping/mapper_plugins.cpp | 85 +++---- src/dwi/tractography/mapping/mapper_plugins.h | 45 ++-- src/dwi/tractography/mapping/twi_stats.cpp | 3 +- src/dwi/tractography/mapping/twi_stats.h | 1 + 10 files changed, 252 insertions(+), 158 deletions(-) rename cmd/{tckdynamicmap.cpp => tckdfc.cpp} (61%) rename docs/reference/commands/{tckdynamicmap.rst => tckdfc.rst} (61%) diff --git a/cmd/tckdynamicmap.cpp b/cmd/tckdfc.cpp similarity index 61% rename from cmd/tckdynamicmap.cpp rename to cmd/tckdfc.cpp index 98ab853740..5378ab282b 100644 --- a/cmd/tckdynamicmap.cpp +++ b/cmd/tckdfc.cpp @@ -45,7 +45,6 @@ using namespace MR::DWI::Tractography::Mapping; -#define DEFAULT_SLIDING_WINDOW_WIDTH 15 const char* windows[] = { "rectangle", "triangle", "cosine", "hann", "hamming", "lanczos", NULL }; @@ -56,10 +55,23 @@ AUTHOR = "Robert E. Smith (robert.smith@florey.edu.au)"; SYNOPSIS = "Perform the Track-Weighted Dynamic Functional Connectivity (TW-dFC) method."; DESCRIPTION - + "This command generates a sliding-window Track-Weighted Image (TWI), where " - "the contribution from each streamline to the image at each timepoint is the " - "Pearson correlation between the fMRI time series at the streamline endpoints, " - "within a sliding temporal window centred at that timepoint."; + + "This command generates a Track-Weighted Image (TWI), where the " + "contribution from each streamline to the image is the Pearson " + "correlation between the fMRI time series at the streamline endpoints." + + + "The output image can be generated in one of two ways " + "(note that one of these two command-line options MUST be provided): " + + + "- \"Static\" functional connectivity (-static option): " + "Each streamline contributes to a static 3D output image based on the " + "correlation between the signals at the streamline endpoints using the " + "entirety of the input time series." + + + "- \"Dynamic\" functional connectivity (-dynamic option): " + "The output image is a 4D image, with the same number of volumes as " + "the input fMRI time series. For each volume, the contribution from " + "each streamline is calculated based on a finite-width sliding time " + "window, centred at the timepoint corresponding to that volume."; ARGUMENTS + Argument ("tracks", "the input track file.").type_file_in() @@ -67,6 +79,19 @@ ARGUMENTS + Argument ("output", "the output TW-dFC image").type_image_out(); OPTIONS + + OptionGroup ("Options for toggling between static and dynamic TW-dFC methods; " + "note that one of these options MUST be provided") + + + Option ("static", "generate a \"static\" (3D) output image.") + + + Option ("dynamic", "generate a \"dynamic\" (4D) output image; " + "must additionally provide the shape and width (in volumes) of the sliding window.") + + Argument ("shape").type_choice (windows) + + Argument ("width").type_integer (3) + + + + OptionGroup ("Options for setting the properties of the output image") + + Option ("template", "an image file to be used as a template for the output (the output image " "will have the same transform and field of view).") @@ -83,12 +108,8 @@ OPTIONS "Options are: " + join(voxel_statistics, ", ") + " (default: mean)") + Argument ("type").type_choice (voxel_statistics) - + Option ("window_shape", "specify the shape of the sliding window weighting function. " - "Options are: rectangle, triangle, cosine, hann, hamming, lanczos (default = rectangle)") - + Argument ("shape").type_choice (windows) - + Option ("window_width", "set the full width of the sliding window (in volumes, not time) (must be an odd number) (default = " + str(DEFAULT_SLIDING_WINDOW_WIDTH) + ")") - + Argument ("value").type_integer (3) + + OptionGroup ("Other options for affecting the streamline sampling & mapping behaviour") + Option ("backtrack", "if no valid timeseries is found at the streamline endpoint, backtrack along " @@ -99,6 +120,7 @@ OPTIONS "(if omitted, an appropriate ratio will be determined automatically)") + Argument ("factor").type_integer (1); + REFERENCES + "Calamante, F.; Smith, R.E.; Liang, X.; Zalesky, A.; Connelly, A " // Internal "Track-weighted dynamic functional connectivity (TW-dFC): a new method to study time-resolved functional connectivity. " @@ -204,7 +226,66 @@ class Count_receiver -void run () { +void run () +{ + bool is_static = get_options ("static").size(); + vector window; + + auto opt = get_options ("dynamic"); + if (opt.size()) { + if (is_static) + throw Exception ("Do not specify both -static and -dynamic options"); + + // Generate the window filter + const int window_shape = opt[0][0]; + const ssize_t window_width = opt[0][1]; + if (!(window_width % 2)) + throw Exception ("Width of sliding time window must be an odd integer"); + + window.resize (window_width); + const ssize_t halfwidth = (window_width+1) / 2; + const ssize_t centre = (window_width-1) / 2; // Element at centre of the window + + switch (window_shape) { + + case 0: // rectangular + window.assign (window_width, 1.0); + break; + + case 1: // triangle + for (ssize_t i = 0; i != window_width; ++i) + window[i] = 1.0 - (std::abs (i - centre) / default_type(halfwidth)); + break; + + case 2: // cosine + for (ssize_t i = 0; i != window_width; ++i) + window[i] = std::sin (i * Math::pi / default_type(window_width - 1)); + break; + + case 3: // hann + for (ssize_t i = 0; i != window_width; ++i) + window[i] = 0.5 * (1.0 - std::cos (2.0 * Math::pi * i / default_type(window_width - 1))); + break; + + case 4: // hamming + for (ssize_t i = 0; i != window_width; ++i) + window[i] = 0.53836 - (0.46164 * std::cos (2.0 * Math::pi * i / default_type(window_width - 1))); + break; + + case 5: // lanczos + for (ssize_t i = 0; i != window_width; ++i) { + const default_type v = 2.0 * Math::pi * std::abs (i - centre) / default_type(window_width - 1); + window[i] = v ? std::max (0.0, (std::sin (v) / v)) : 1.0; + } + break; + + default: + throw Exception ("Unsupported sliding window shape"); + } + + } else if (!is_static) { + throw Exception ("Either the -static or -dynamic option must be provided"); + } const std::string tck_path = argument[0]; Tractography::Properties properties; @@ -218,7 +299,7 @@ void run () { Image fmri_image (Image::open (argument[1]).with_direct_io(3)); vector voxel_size; - auto opt = get_options("vox"); + opt = get_options("vox"); if (opt.size()) voxel_size = parse_floats (opt[0][0]); @@ -244,8 +325,12 @@ void run () { header.datatype() = DataType::Float32; header.datatype().set_byte_order_native(); - header.ndim() = 4; - header.size(3) = fmri_image.size(3); + if (is_static) { + header.ndim() = 3; + } else { + header.ndim() = 4; + header.size(3) = fmri_image.size(3); + } add_line (header.keyval()["comments"], "TW-dFC image"); size_t upsample_ratio; @@ -267,95 +352,57 @@ void run () { opt = get_options ("stat_vox"); const vox_stat_t stat_vox = opt.size() ? vox_stat_t(int(opt[0][0])) : V_MEAN; - // Generate the window filter - const ssize_t window_width = get_option_value ("window_width", DEFAULT_SLIDING_WINDOW_WIDTH); - if (!(window_width % 2)) - throw Exception ("Width of sliding time window must be an odd integer"); - const int window_shape = get_option_value ("window_shape", 0); // default = rectangular - - vector window (window_width, 0.0); - const ssize_t halfwidth = (window_width+1) / 2; - const ssize_t centre = (window_width-1) / 2; // Element at centre of the window - - switch (window_shape) { - - case 0: // rectangular - window.assign (window_width, 1.0); - break; - - case 1: // triangle - for (ssize_t i = 0; i != window_width; ++i) - window[i] = 1.0 - (std::abs (i - centre) / default_type(halfwidth)); - break; - - case 2: // cosine - for (ssize_t i = 0; i != window_width; ++i) - window[i] = std::sin (i * Math::pi / default_type(window_width - 1)); - break; - - case 3: // hann - for (ssize_t i = 0; i != window_width; ++i) - window[i] = 0.5 * (1.0 - std::cos (2.0 * Math::pi * i / default_type(window_width - 1))); - break; - - case 4: // hamming - for (ssize_t i = 0; i != window_width; ++i) - window[i] = 0.53836 - (0.46164 * std::cos (2.0 * Math::pi * i / default_type(window_width - 1))); - break; - - case 5: // lanczos - for (ssize_t i = 0; i != window_width; ++i) { - const default_type v = 2.0 * Math::pi * std::abs (i - centre) / default_type(window_width - 1); - window[i] = v ? std::max (0.0, (std::sin (v) / v)) : 1.0; - } - break; - - default: - throw Exception ("Unsupported sliding window shape"); - } - - // TODO Reconsider pre-calculating & storing SetVoxel for each streamline - // - Faster, but ups RAM requirements, may become prohibitive with super-resolution - // TODO Add voxel-wise statistic V_MEAN_ABS - mean absolute value? - - Image out_image (Image::create (argument[2], header)); Header H_3D (header); H_3D.ndim() = 3; - Image counts; - if (stat_vox == V_MEAN) { - counts = Image::scratch (H_3D, "Track count scratch buffer"); + if (is_static) { + Tractography::Reader tck_file (tck_path, properties); - Mapping::TrackLoader loader (tck_file, num_tracks, "Calculating initial TDI"); - Mapping::TrackMapperBase mapper (H_3D); + Mapping::TrackLoader loader (tck_file, num_tracks, "Generating (static) TW-dFC image"); + Mapping::TrackMapperTWI mapper (H_3D, SCALAR_MAP, ENDS_CORR); mapper.set_upsample_ratio (upsample_ratio); - Count_receiver receiver (counts); - Thread::run_queue (loader, Thread::batch (Tractography::Streamline<>()), Thread::multi (mapper), Thread::batch (Mapping::SetVoxel()), receiver); - } + mapper.add_twdfc_static_image (fmri_image); + Mapping::MapWriter writer (header, argument[2], stat_vox); + Thread::run_queue (loader, Thread::batch (Tractography::Streamline<>()), Thread::multi (mapper), Thread::batch (Mapping::SetVoxel()), writer); - ProgressBar progress ("Generating TW-dFC image", header.size(3)); - for (ssize_t timepoint = 0; timepoint != header.size(3); ++timepoint) { + } else { - { - LogLevelLatch latch (0); + Image counts; + if (stat_vox == V_MEAN) { + counts = Image::scratch (H_3D, "Track count scratch buffer"); Tractography::Reader tck_file (tck_path, properties); - Mapping::TrackLoader loader (tck_file); - Mapping::TrackMapperTWI mapper (H_3D, SCALAR_MAP, ENDS_CORR); + Mapping::TrackLoader loader (tck_file, num_tracks, "Calculating initial TDI"); + Mapping::TrackMapperBase mapper (H_3D); mapper.set_upsample_ratio (upsample_ratio); - mapper.add_twdfc_image (fmri_image, window, timepoint); - Receiver receiver (H_3D, stat_vox); + Count_receiver receiver (counts); Thread::run_queue (loader, Thread::batch (Tractography::Streamline<>()), Thread::multi (mapper), Thread::batch (Mapping::SetVoxel()), receiver); + } - if (stat_vox == V_MEAN) - receiver.scale_by_count (counts); + Image out_image (Image::create (argument[2], header)); + ProgressBar progress ("Generating TW-dFC image", header.size(3)); + for (ssize_t timepoint = 0; timepoint != header.size(3); ++timepoint) { + + { + LogLevelLatch latch (0); + Tractography::Reader tck_file (tck_path, properties); + Mapping::TrackLoader loader (tck_file); + Mapping::TrackMapperTWI mapper (H_3D, SCALAR_MAP, ENDS_CORR); + mapper.set_upsample_ratio (upsample_ratio); + mapper.add_twdfc_dynamic_image (fmri_image, window, timepoint); + Receiver receiver (H_3D, stat_vox); + Thread::run_queue (loader, Thread::batch (Tractography::Streamline<>()), Thread::multi (mapper), Thread::batch (Mapping::SetVoxel()), receiver); + + if (stat_vox == V_MEAN) + receiver.scale_by_count (counts); + + out_image.index(3) = timepoint; + receiver.write (out_image); + } - out_image.index(3) = timepoint; - receiver.write (out_image); + ++progress; } - ++progress; } - } diff --git a/docs/reference/commands/tckdynamicmap.rst b/docs/reference/commands/tckdfc.rst similarity index 61% rename from docs/reference/commands/tckdynamicmap.rst rename to docs/reference/commands/tckdfc.rst index 10f763769b..5e50695af4 100644 --- a/docs/reference/commands/tckdynamicmap.rst +++ b/docs/reference/commands/tckdfc.rst @@ -1,6 +1,6 @@ -.. _tckdynamicmap: +.. _tckdfc: -tckdynamicmap +tckdfc =================== Synopsis @@ -13,7 +13,7 @@ Usage :: - tckdynamicmap [ options ] tracks fmri output + tckdfc [ options ] tracks fmri output - *tracks*: the input track file. - *fmri*: the pre-processed fMRI time series @@ -22,20 +22,35 @@ Usage Description ----------- -This command generates a sliding-window Track-Weighted Image (TWI), where the contribution from each streamline to the image at each timepoint is the Pearson correlation between the fMRI time series at the streamline endpoints, within a sliding temporal window centred at that timepoint. +This command generates a Track-Weighted Image (TWI), where the contribution from each streamline to the image is the Pearson correlation between the fMRI time series at the streamline endpoints. + +The output image can be generated in one of two ways (note that one of these two command-line options MUST be provided): + +- "Static" functional connectivity (-static option): Each streamline contributes to a static 3D output image based on the correlation between the signals at the streamline endpoints using the entirety of the input time series. + +- "Dynamic" functional connectivity (-dynamic option): The output image is a 4D image, with the same number of volumes as the input fMRI time series. For each volume, the contribution from each streamline is calculated based on a finite-width sliding time window, centred at the timepoint corresponding to that volume. Options ------- +Options for toggling between static and dynamic TW-dFC methods; note that one of these options MUST be provided +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- **-static** generate a "static" (3D) output image. + +- **-dynamic shape width** generate a "dynamic" (4D) output image; must additionally provide the shape and width (in volumes) of the sliding window. + +Options for setting the properties of the output image +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + - **-template image** an image file to be used as a template for the output (the output image will have the same transform and field of view). - **-vox size** provide either an isotropic voxel size (in mm), or comma-separated list of 3 voxel dimensions. - **-stat_vox type** define the statistic for choosing the final voxel intensities for a given contrast type given the individual values from the tracks passing through each voxelOptions are: sum, min, mean, max (default: mean) -- **-window_shape shape** specify the shape of the sliding window weighting function. Options are: rectangle, triangle, cosine, hann, hamming, lanczos (default = rectangle) - -- **-window_width value** set the full width of the sliding window (in volumes, not time) (must be an odd number) (default = 15) +Other options for affecting the streamline sampling & mapping behaviour +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - **-backtrack** if no valid timeseries is found at the streamline endpoint, backtrack along the streamline trajectory until a valid timeseries is found diff --git a/docs/reference/commands/tckmap.rst b/docs/reference/commands/tckmap.rst index 7fd19fe0e1..138962fd41 100644 --- a/docs/reference/commands/tckmap.rst +++ b/docs/reference/commands/tckmap.rst @@ -55,7 +55,7 @@ Options for the TWI image contrast properties - **-stat_vox type** define the statistic for choosing the final voxel intensities for a given contrast type given the individual values from the tracks passing through each voxel. Options are: sum, min, mean, max (default: sum) -- **-stat_tck type** define the statistic for choosing the contribution to be made by each streamline as a function of the samples taken along their lengths. Only has an effect for 'scalar_map', 'fod_amp' and 'curvature' contrast types. Options are: sum, min, mean, max, median, mean_nonzero, gaussian, ends_min, ends_mean, ends_max, ends_prod, ends_corr (default: mean) +- **-stat_tck type** define the statistic for choosing the contribution to be made by each streamline as a function of the samples taken along their lengths. Only has an effect for 'scalar_map', 'fod_amp' and 'curvature' contrast types. Options are: sum, min, mean, max, median, mean_nonzero, gaussian, ends_min, ends_mean, ends_max, ends_prod (default: mean) - **-fwhm_tck value** when using gaussian-smoothed per-track statistic, specify the desired full-width half-maximum of the Gaussian smoothing kernel (in mm) diff --git a/docs/reference/commands_list.rst b/docs/reference/commands_list.rst index dca49571d1..797dbffb6d 100644 --- a/docs/reference/commands_list.rst +++ b/docs/reference/commands_list.rst @@ -91,7 +91,7 @@ List of MRtrix3 commands commands/tck2connectome commands/tck2fixel commands/tckconvert - commands/tckdynamicmap + commands/tckdfc commands/tckedit commands/tckgen commands/tckglobal @@ -203,7 +203,7 @@ List of MRtrix3 commands :ref:`tck2connectome`, "Generate a connectome matrix from a streamlines file and a node parcellation image" :ref:`tck2fixel`, "Compute a fixel TDI map from a tractogram" :ref:`tckconvert`, "Convert between different track file formats" - :ref:`tckdynamicmap`, "Perform the Track-Weighted Dynamic Functional Connectivity (TW-dFC) method." + :ref:`tckdfc`, "Perform the Track-Weighted Dynamic Functional Connectivity (TW-dFC) method." :ref:`tckedit`, "Perform various editing operations on track files" :ref:`tckgen`, "Perform streamlines tractography" :ref:`tckglobal`, "Multi-Shell Multi-Tissue Global Tractography" diff --git a/src/dwi/tractography/mapping/mapper.cpp b/src/dwi/tractography/mapping/mapper.cpp index b4cfbad5a4..a9de067ffb 100644 --- a/src/dwi/tractography/mapping/mapper.cpp +++ b/src/dwi/tractography/mapping/mapper.cpp @@ -201,7 +201,18 @@ void TrackMapperTWI::add_fod_image (const std::string& path) image_plugin.reset (new TWIFODImagePlugin (path, track_statistic)); } -void TrackMapperTWI::add_twdfc_image (Image& image, const vector& kernel, const ssize_t timepoint) +void TrackMapperTWI::add_twdfc_static_image (Image& image) +{ + if (image_plugin) + throw Exception ("Cannot add more than one associated image to TWI"); + if (contrast != SCALAR_MAP) + throw Exception ("For fMRI correlation mapping, mapper must be set to SCALAR_MAP contrast"); + if (track_statistic != ENDS_CORR) + throw Exception ("For fMRI correlation mapping, only the endpoint correlation track-wise statistic is valid"); + image_plugin.reset (new TWDFCStaticImagePlugin (image)); +} + +void TrackMapperTWI::add_twdfc_dynamic_image (Image& image, const vector& kernel, const ssize_t timepoint) { if (image_plugin) throw Exception ("Cannot add more than one associated image to TWI"); @@ -209,7 +220,7 @@ void TrackMapperTWI::add_twdfc_image (Image& image, const vector& throw Exception ("For sliding time-window fMRI mapping, mapper must be set to SCALAR_MAP contrast"); if (track_statistic != ENDS_CORR) throw Exception ("For sliding time-window fMRI mapping, only the endpoint correlation track-wise statistic is valid"); - image_plugin.reset (new TWDFCImagePlugin (image, kernel, timepoint)); + image_plugin.reset (new TWDFCDynamicImagePlugin (image, kernel, timepoint)); } void TrackMapperTWI::add_vector_data (const std::string& path) diff --git a/src/dwi/tractography/mapping/mapper.h b/src/dwi/tractography/mapping/mapper.h index 41d413f26d..f99f957033 100644 --- a/src/dwi/tractography/mapping/mapper.h +++ b/src/dwi/tractography/mapping/mapper.h @@ -370,7 +370,8 @@ namespace MR { void add_scalar_image (const std::string&); void set_backtrack(); void add_fod_image (const std::string&); - void add_twdfc_image (Image&, const vector&, const ssize_t); + void add_twdfc_static_image (Image&); + void add_twdfc_dynamic_image (Image&, const vector&, const ssize_t); void add_vector_data (const std::string&); diff --git a/src/dwi/tractography/mapping/mapper_plugins.cpp b/src/dwi/tractography/mapping/mapper_plugins.cpp index d552c77e70..2957bba519 100644 --- a/src/dwi/tractography/mapping/mapper_plugins.cpp +++ b/src/dwi/tractography/mapping/mapper_plugins.cpp @@ -122,45 +122,6 @@ namespace MR { } } - } else if (statistic == ENDS_CORR) { - - // Use trilinear interpolation - // Store values into local vectors, since it's a two-pass operation - factors.assign (1, NaN); - vector values[2]; - for (size_t tck_end_index = 0; tck_end_index != 2; ++tck_end_index) { - const ssize_t index = get_end_index (tck, bool(tck_end_index)); - if (index < 0) - return; - if (!interp.scanner (tck[index])) - return; - values[tck_end_index].reserve (interp.size(3)); - for (interp.index(3) = 0; interp.index(3) != interp.size(3); ++interp.index(3)) - values[tck_end_index].push_back (interp.value()); - } - - // Calculate the Pearson correlation coefficient - default_type sums[2] = { 0.0, 0.0 }; - for (ssize_t i = 0; i != interp.size(3); ++i) { - sums[0] += values[0][i]; - sums[1] += values[1][i]; - } - const default_type means[2] = { sums[0] / default_type(interp.size(3)), sums[1] / default_type(interp.size(3)) }; - - default_type product = 0.0; - default_type variances[2] = { 0.0, 0.0 }; - for (ssize_t i = 0; i != interp.size(3); ++i) { - product += ((values[0][i] - means[0]) * (values[1][i] - means[1])); - variances[0] += Math::pow2 (values[0][i] - means[0]); - variances[1] += Math::pow2 (values[1][i] - means[1]); - } - const default_type product_expectation = product / default_type(interp.size(3)); - const default_type stdevs[2] = { std::sqrt (variances[0] / default_type(interp.size(3)-1)), - std::sqrt (variances[1] / default_type(interp.size(3)-1)) }; - - if (stdevs[0] && stdevs[1]) - factors[0] = product_expectation / (stdevs[0] * stdevs[1]); - } else { // The entire length of the track contributes @@ -171,7 +132,6 @@ namespace MR { factors.push_back (NaN); } - } } @@ -222,7 +182,50 @@ namespace MR { - void TWDFCImagePlugin::load_factors (const Streamline<>& tck, vector& factors) const + void TWDFCStaticImagePlugin::load_factors (const Streamline<>& tck, vector& factors) const + { + // Use trilinear interpolation + // Store values into local vectors, since it's a two-pass operation + factors.assign (1, NaN); + vector values[2]; + for (size_t tck_end_index = 0; tck_end_index != 2; ++tck_end_index) { + const ssize_t index = get_end_index (tck, bool(tck_end_index)); + if (index < 0) + return; + if (!interp.scanner (tck[index])) + return; + values[tck_end_index].reserve (interp.size(3)); + for (interp.index(3) = 0; interp.index(3) != interp.size(3); ++interp.index(3)) + values[tck_end_index].push_back (interp.value()); + } + + // Calculate the Pearson correlation coefficient + default_type sums[2] = { 0.0, 0.0 }; + for (ssize_t i = 0; i != interp.size(3); ++i) { + sums[0] += values[0][i]; + sums[1] += values[1][i]; + } + const default_type means[2] = { sums[0] / default_type(interp.size(3)), sums[1] / default_type(interp.size(3)) }; + + default_type product = 0.0; + default_type variances[2] = { 0.0, 0.0 }; + for (ssize_t i = 0; i != interp.size(3); ++i) { + product += ((values[0][i] - means[0]) * (values[1][i] - means[1])); + variances[0] += Math::pow2 (values[0][i] - means[0]); + variances[1] += Math::pow2 (values[1][i] - means[1]); + } + const default_type product_expectation = product / default_type(interp.size(3)); + const default_type stdevs[2] = { std::sqrt (variances[0] / default_type(interp.size(3)-1)), + std::sqrt (variances[1] / default_type(interp.size(3)-1)) }; + + if (stdevs[0] && stdevs[1]) + factors[0] = product_expectation / (stdevs[0] * stdevs[1]); + } + + + + + void TWDFCDynamicImagePlugin::load_factors (const Streamline<>& tck, vector& factors) const { assert (statistic == ENDS_CORR); factors.assign (1, NaN); diff --git a/src/dwi/tractography/mapping/mapper_plugins.h b/src/dwi/tractography/mapping/mapper_plugins.h index c7503312ff..76aba646a7 100644 --- a/src/dwi/tractography/mapping/mapper_plugins.h +++ b/src/dwi/tractography/mapping/mapper_plugins.h @@ -121,15 +121,11 @@ namespace MR { TWIScalarImagePlugin (const std::string& input_image, const tck_stat_t track_statistic) : TWIImagePluginBase (input_image, track_statistic) { - if (statistic == ENDS_CORR) { - if (interp.ndim() != 4) - throw Exception ("Image provided for ends_corr statistic must be a 4D image"); - } else { - if (!((interp.ndim() == 3) || (interp.ndim() == 4 && interp.size(3) == 1))) - throw Exception ("Scalar image used for TWI must be a 3D image"); - if (interp.ndim() == 4) - interp.index(3) = 0; - } + assert (statistic != ENDS_CORR); + if (!((interp.ndim() == 3) || (interp.ndim() == 4 && interp.size(3) == 1))) + throw Exception ("Scalar image used for TWI must be a 3D image"); + if (interp.ndim() == 4) + interp.index(3) = 0; } TWIScalarImagePlugin (const TWIScalarImagePlugin& that) : @@ -181,20 +177,39 @@ namespace MR { - class TWDFCImagePlugin : public TWIImagePluginBase - { MEMALIGN(TWDFCImagePlugin) + class TWDFCStaticImagePlugin : public TWIImagePluginBase + { MEMALIGN(TWDFCStaticImagePlugin) + public: + TWDFCStaticImagePlugin (Image& input_image) : + TWIImagePluginBase (input_image, ENDS_CORR) { } + + TWDFCStaticImagePlugin (const TWDFCStaticImagePlugin& that) = default; + + TWDFCStaticImagePlugin* clone() const override + { + return new TWDFCStaticImagePlugin (*this); + } + + void load_factors (const Streamline<>&, vector&) const override; + }; + + + + + class TWDFCDynamicImagePlugin : public TWIImagePluginBase + { MEMALIGN(TWDFCDynamicImagePlugin) public: - TWDFCImagePlugin (Image& input_image, const vector& kernel, const ssize_t timepoint) : + TWDFCDynamicImagePlugin (Image& input_image, const vector& kernel, const ssize_t timepoint) : TWIImagePluginBase (input_image, ENDS_CORR), kernel (kernel), kernel_centre ((kernel.size()-1) / 2), sample_centre (timepoint) { } - TWDFCImagePlugin (const TWDFCImagePlugin& that) = default; + TWDFCDynamicImagePlugin (const TWDFCDynamicImagePlugin& that) = default; - TWDFCImagePlugin* clone() const override + TWDFCDynamicImagePlugin* clone() const override { - return new TWDFCImagePlugin (*this); + return new TWDFCDynamicImagePlugin (*this); } void load_factors (const Streamline<>&, vector&) const override; diff --git a/src/dwi/tractography/mapping/twi_stats.cpp b/src/dwi/tractography/mapping/twi_stats.cpp index f0ff7bbc79..fa90a2a9bb 100644 --- a/src/dwi/tractography/mapping/twi_stats.cpp +++ b/src/dwi/tractography/mapping/twi_stats.cpp @@ -23,7 +23,8 @@ namespace Mapping { const char* contrasts[] = { "tdi", "length", "invlength", "scalar_map", "scalar_map_count", "fod_amp", "curvature", "vector_file", 0 }; const char* voxel_statistics[] = { "sum", "min", "mean", "max", 0 }; -const char* track_statistics[] = { "sum", "min", "mean", "max", "median", "mean_nonzero", "gaussian", "ends_min", "ends_mean", "ends_max", "ends_prod", "ends_corr", 0 }; +// Note: ENDS_CORR not provided as a command-line option +const char* track_statistics[] = { "sum", "min", "mean", "max", "median", "mean_nonzero", "gaussian", "ends_min", "ends_mean", "ends_max", "ends_prod", 0 }; } diff --git a/src/dwi/tractography/mapping/twi_stats.h b/src/dwi/tractography/mapping/twi_stats.h index 16944a86aa..d33760f284 100644 --- a/src/dwi/tractography/mapping/twi_stats.h +++ b/src/dwi/tractography/mapping/twi_stats.h @@ -24,6 +24,7 @@ namespace Mapping { enum contrast_t { TDI, LENGTH, INVLENGTH, SCALAR_MAP, SCALAR_MAP_COUNT, FOD_AMP, CURVATURE, VECTOR_FILE }; enum vox_stat_t { V_SUM, V_MIN, V_MEAN, V_MAX }; +// Note: ENDS_CORR not provided as a command-line option enum tck_stat_t { T_SUM, T_MIN, T_MEAN, T_MAX, T_MEDIAN, T_MEAN_NONZERO, GAUSSIAN, ENDS_MIN, ENDS_MEAN, ENDS_MAX, ENDS_PROD, ENDS_CORR }; extern const char* contrasts[]; From 961e5585d07160fd7fff1221c7fce9187dd49e55 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 31 Jul 2017 15:21:27 +1000 Subject: [PATCH 050/538] tckmap: Remove TW-dFC reference --- cmd/tckmap.cpp | 5 ----- docs/reference/commands/tckmap.rst | 2 -- 2 files changed, 7 deletions(-) diff --git a/cmd/tckmap.cpp b/cmd/tckmap.cpp index 61bb6da6b4..04309916d8 100644 --- a/cmd/tckmap.cpp +++ b/cmd/tckmap.cpp @@ -194,11 +194,6 @@ REFERENCES "Track Orientation Density Imaging (TODI) and Track Orientation Distribution (TOD) based tractography. " "NeuroImage, 2014, 94, 312-336" - + "* If using -contrast scalar_map and -stat_tck ends_corr:\n" - "Calamante, F.; Smith, R.E.; Liang, X.; Zalesky, A.; Connelly, A " // Internal - "Track-weighted dynamic functional connectivity (TW-dFC): a new method to study time-resolved functional connectivity. " - "Brain Struct Funct, 2017, doi: 10.1007/s00429-017-1431-1" - + "* If using other contrasts / statistics:\n" "Calamante, F.; Tournier, J.-D.; Smith, R. E. & Connelly, A. " // Internal "A generalised framework for super-resolution track-weighted imaging. " diff --git a/docs/reference/commands/tckmap.rst b/docs/reference/commands/tckmap.rst index 138962fd41..37ed91e9aa 100644 --- a/docs/reference/commands/tckmap.rst +++ b/docs/reference/commands/tckmap.rst @@ -106,8 +106,6 @@ References * If using -tod option:Dhollander, T., Emsell, L., Van Hecke, W., Maes, F., Sunaert, S., Suetens, P. Track Orientation Density Imaging (TODI) and Track Orientation Distribution (TOD) based tractography. NeuroImage, 2014, 94, 312-336 -* If using -contrast scalar_map and -stat_tck ends_corr:Calamante, F.; Smith, R.E.; Liang, X.; Zalesky, A.; Connelly, A Track-weighted dynamic functional connectivity (TW-dFC): a new method to study time-resolved functional connectivity. Brain Struct Funct, 2017, doi: 10.1007/s00429-017-1431-1 - * If using other contrasts / statistics:Calamante, F.; Tournier, J.-D.; Smith, R. E. & Connelly, A. A generalised framework for super-resolution track-weighted imaging. NeuroImage, 2012, 59, 2494-2503 * If using -precise mapping option:Smith, R. E.; Tournier, J.-D.; Calamante, F. & Connelly, A. SIFT: Spherical-deconvolution informed filtering of tractograms. NeuroImage, 2013, 67, 298-312 (Appendix 3) From ff90e56e0c52b345231a29736b8236bca6138bd8 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 31 Jul 2017 16:16:47 +1000 Subject: [PATCH 051/538] tckdfc: More verbose description of -backtrack option --- cmd/tckdfc.cpp | 12 ++++++++++-- docs/reference/commands/tckdfc.rst | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cmd/tckdfc.cpp b/cmd/tckdfc.cpp index 5378ab282b..c6ccab4409 100644 --- a/cmd/tckdfc.cpp +++ b/cmd/tckdfc.cpp @@ -112,8 +112,16 @@ OPTIONS + OptionGroup ("Other options for affecting the streamline sampling & mapping behaviour") + Option ("backtrack", - "if no valid timeseries is found at the streamline endpoint, backtrack along " - "the streamline trajectory until a valid timeseries is found") + "if no valid timeseries is found at the streamline endpoint, back-track along " + "the streamline trajectory until a valid timeseries is found. \n" + "Note that this mechanism is similar, but not precisely equivalent, to" + "back-tracking as can be used with Anatomically-Constrained Tractography (ACT) " + "in the tckgen command. However, here the feature does not change the " + "streamlines trajectories in any way; it simply enables detection of the fact " + "that the input fMRI image may not contain a valid timeseries underneath the " + "streamline endpoint, and where this occurs, searches from the streamline " + "endpoint inwards along the streamline trajectory in search of a valid " + "timeseries to sample from the input image.") + Option ("upsample", "upsample the tracks by some ratio using Hermite interpolation before mappipng \n" diff --git a/docs/reference/commands/tckdfc.rst b/docs/reference/commands/tckdfc.rst index 5e50695af4..934d2d8a51 100644 --- a/docs/reference/commands/tckdfc.rst +++ b/docs/reference/commands/tckdfc.rst @@ -52,7 +52,7 @@ Options for setting the properties of the output image Other options for affecting the streamline sampling & mapping behaviour ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-backtrack** if no valid timeseries is found at the streamline endpoint, backtrack along the streamline trajectory until a valid timeseries is found +- **-backtrack** if no valid timeseries is found at the streamline endpoint, back-track along the streamline trajectory until a valid timeseries is found. Note that this mechanism is similar, but not precisely equivalent, toback-tracking as can be used with Anatomically-Constrained Tractography (ACT) in the tckgen command. However, here the feature does not change the streamlines trajectories in any way; it simply enables detection of the fact that the input fMRI image may not contain a valid timeseries underneath the streamline endpoint, and where this occurs, searches from the streamline endpoint inwards along the streamline trajectory in search of a valid timeseries to sample from the input image. - **-upsample factor** upsample the tracks by some ratio using Hermite interpolation before mappipng (if omitted, an appropriate ratio will be determined automatically) From 1008ab7f35a7b871abfbc3ba92cad644d55f5433 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 3 Aug 2017 15:43:36 +1000 Subject: [PATCH 052/538] fsl.exeName(): New function Remove a lot of redundant code relating to checking for the presence of FSL executables. --- bin/dwibiascorrect | 6 +----- bin/dwipreproc | 14 ++------------ bin/labelsgmfix | 7 +------ lib/mrtrix3/_5ttgen/fsl.py | 28 ++++------------------------ lib/mrtrix3/fsl.py | 24 +++++++++++++++++++----- 5 files changed, 27 insertions(+), 52 deletions(-) diff --git a/bin/dwibiascorrect b/bin/dwibiascorrect index 677e661ef2..a690a28fe6 100755 --- a/bin/dwibiascorrect +++ b/bin/dwibiascorrect @@ -42,11 +42,7 @@ if app.args.fsl: if not fsl_path: app.error('Environment variable FSLDIR is not set; please run appropriate FSL configuration script') - fast_cmd = 'fast' - if not find_executable(fast_cmd): - fast_cmd = 'fsl5.0-fast' - if not find_executable(fast_cmd): - app.error('Could not find FSL program fast; please verify FSL install') + fast_cmd = fsl.exeName('fast') fsl_suffix = fsl.suffix() if fast_cmd == 'fast': diff --git a/bin/dwipreproc b/bin/dwipreproc index a807c6823a..5c0ff8cd4a 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -91,18 +91,8 @@ if not PE_design == 'None': topup_config_path = os.path.join(fsl_path, 'etc', 'flirtsch', 'b02b0.cnf') if not os.path.isfile(topup_config_path): app.error('Could not find necessary default config file for FSL\'s topup program\n(expected location: ' + topup_config_path + ')') - - topup_cmd = 'topup' - if not find_executable(topup_cmd): - topup_cmd = 'fsl5.0-topup' - if not find_executable(topup_cmd): - app.error('Could not find FSL program topup; please verify FSL install') - - applytopup_cmd = 'applytopup' - if not find_executable(applytopup_cmd): - applytopup_cmd = 'fsl5.0-applytopup' - if not find_executable(applytopup_cmd): - app.error('Could not find FSL program applytopup; please verify FSL install') + topup_cmd = fsl.exeName('topup') + applytopup_cmd = fsl.exeName('applytopup') eddy_cmd = fsl.eddyBinary(app.args.cuda) fsl_suffix = fsl.suffix() diff --git a/bin/labelsgmfix b/bin/labelsgmfix index 6faa48bdcc..df32e08d08 100755 --- a/bin/labelsgmfix +++ b/bin/labelsgmfix @@ -45,14 +45,9 @@ fsl_path = os.environ.get('FSLDIR', '') if not fsl_path: app.error('Environment variable FSLDIR is not set; please run appropriate FSL configuration script') -first_cmd = 'run_first_all' -if not find_executable(first_cmd): - first_cmd = "fsl5.0-run_first_all" - if not find_executable(first_cmd): - app.error('Could not find FSL program run_first_all; please verify FSL install') +first_cmd = fsl.exeName('run_first_all') first_atlas_path = os.path.join(fsl_path, 'data', 'first', 'models_336_bin') - if not os.path.isdir(first_atlas_path): app.error('Atlases required for FSL\'s FIRST program not installed;\nPlease install fsl-first-data using your relevant package manager') diff --git a/lib/mrtrix3/_5ttgen/fsl.py b/lib/mrtrix3/_5ttgen/fsl.py index 61a86239bf..267612a70c 100644 --- a/lib/mrtrix3/_5ttgen/fsl.py +++ b/lib/mrtrix3/_5ttgen/fsl.py @@ -48,32 +48,12 @@ def execute(): if not fsl_path: app.error('Environment variable FSLDIR is not set; please run appropriate FSL configuration script') - ssroi_cmd = 'standard_space_roi' - if not find_executable(ssroi_cmd): - ssroi_cmd = 'fsl5.0-standard_space_roi' - if not find_executable(ssroi_cmd): - app.error('Could not find FSL program standard_space_roi; please verify FSL install') - - bet_cmd = 'bet' - if not find_executable(bet_cmd): - bet_cmd = 'fsl5.0-bet' - if not find_executable(bet_cmd): - app.error('Could not find FSL program bet; please verify FSL install') - - fast_cmd = 'fast' - if not find_executable(fast_cmd): - fast_cmd = 'fsl5.0-fast' - if not find_executable(fast_cmd): - app.error('Could not find FSL program fast; please verify FSL install') - - first_cmd = 'run_first_all' - if not find_executable(first_cmd): - first_cmd = "fsl5.0-run_first_all" - if not find_executable(first_cmd): - app.error('Could not find FSL program run_first_all; please verify FSL install') + bet_cmd = fsl.exeName('bet') + fast_cmd = fsl.exeName('fast') + first_cmd = fsl.exeName('run_first_all') + ssroi_cmd = fsl.exeName('standard_space_roi') first_atlas_path = os.path.join(fsl_path, 'data', 'first', 'models_336_bin') - if not os.path.isdir(first_atlas_path): app.error('Atlases required for FSL\'s FIRST program not installed; please install fsl-first-data using your relevant package manager') diff --git a/lib/mrtrix3/fsl.py b/lib/mrtrix3/fsl.py index 4e27e7b17a..91336d15c8 100644 --- a/lib/mrtrix3/fsl.py +++ b/lib/mrtrix3/fsl.py @@ -40,17 +40,31 @@ def eddyBinary(cuda): app.warn('CUDA version of eddy not found; running standard version') if find_executable('eddy_openmp'): path = 'eddy_openmp' - elif find_executable('eddy'): - path = 'eddy' - elif find_executable('fsl5.0-eddy'): - path = 'fsl5.0-eddy' else: - app.error('Could not find FSL program eddy; please verify FSL install') + path = exeName('eddy') app.debug(path) return path +# In some FSL installations, all binaries get prepended with "fsl5.0-". This function +# makes it more convenient to locate these commands. +# Note that if FSL 4 and 5 are installed side-by-side, the approach taken in this +# function will select the version 5 executable. +def exeName(name): + from mrtrix3 import app + from distutils.spawn import find_executable + if find_executable('fsl5.0-' + name): + output = 'fsl5.0-' + name + elif find_executable(name): + output = name + else: + app.error('Could not find FSL program \"' + name + '\"; please verify FSL install') + app.debug(output) + return output + + + # For many FSL commands, the format of any output images will depend on the string # stored in 'FSLOUTPUTTYPE'. This may even override a filename extension provided # to the relevant command. Therefore use this function to 'guess' what the names From 06718b4ccac58fe2b0a5d53f7202f4ac7efe6cc8 Mon Sep 17 00:00:00 2001 From: Rami Tabbara Date: Mon, 7 Aug 2017 17:58:12 +1000 Subject: [PATCH 053/538] mrview: Tract geom: Support large point size geometry * Added support for point size geometry > 1px * Avoid potentially skipping vertices when rendering lines/points * Skipping included when rendering pseudotubes to allow smooth rendering of thick streamtube quads (relative to the FoV) --- .../mrview/tool/tractography/tractogram.cpp | 22 ++++++++++++++++--- .../mrview/tool/tractography/tractography.cpp | 9 ++++++++ .../mrview/tool/tractography/tractography.h | 1 + 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/gui/mrview/tool/tractography/tractogram.cpp b/src/gui/mrview/tool/tractography/tractogram.cpp index a5a3e203c7..764ec92609 100644 --- a/src/gui/mrview/tool/tractography/tractogram.cpp +++ b/src/gui/mrview/tool/tractography/tractogram.cpp @@ -212,6 +212,7 @@ namespace MR { const Tractogram& tractogram = dynamic_cast(displayable); bool using_geom = geometry_type == TrackGeometryType::Pseudotubes; + bool using_points = geometry_type == TrackGeometryType::Points; std::string source = "uniform float lower, upper;\n" @@ -237,6 +238,12 @@ namespace MR source += "void main() {\n"; + + if (using_points) + source += + "if(dot(gl_PointCoord-0.5,gl_PointCoord-0.5)>0.25)\n" + " discard;\n"; + if (do_crop_to_slab) source += using_geom ? " if (g_include < 0.0 || g_include > 1.0) discard;\n" @@ -430,7 +437,7 @@ namespace MR original_fov = std::pow (dim[0]*dim[1]*dim[2], 1.0f/3.0f); } - line_thickness_screenspace = geometry_type != TrackGeometryType::Pseudotubes ? 1.f : + line_thickness_screenspace = tractography_tool.line_thickness*original_fov*(transform.width()+transform.height()) / ( 2.0*window().FOV()*transform.width()*transform.height()); @@ -438,6 +445,10 @@ namespace MR gl::Uniform1f (gl::GetUniformLocation (track_shader, "scale_x"), transform.width()); gl::Uniform1f (gl::GetUniformLocation (track_shader, "scale_y"), transform.height()); + float point_size_screenspace = tractography_tool.point_size*original_fov / window().FOV(); + + glPointSize(point_size_screenspace); + if (tractography_tool.line_opacity < 1.0) { gl::Enable (gl::BLEND); gl::BlendEquation (gl::FUNC_ADD); @@ -535,8 +546,12 @@ namespace MR { // TODO This should perhaps be using "output_step_size" if present? float step_size = (properties.find ("step_size") == properties.end() ? 0.0 : to(properties["step_size"])); - GLint new_stride = GLint (tractography_tool.line_thickness * original_fov / step_size); - new_stride = std::max (1, std::min (max_sample_stride, new_stride)); + GLint new_stride = 1; + + if (geometry_type == TrackGeometryType::Pseudotubes) { + new_stride = GLint (tractography_tool.line_thickness * original_fov / step_size); + new_stride = std::max (1, std::min (max_sample_stride, new_stride)); + } if (new_stride != sample_stride) { sample_stride = new_stride; @@ -891,6 +906,7 @@ namespace MR void Tractogram::set_geometry_type (const TrackGeometryType t) { geometry_type = t; + should_update_stride = true; } diff --git a/src/gui/mrview/tool/tractography/tractography.cpp b/src/gui/mrview/tool/tractography/tractography.cpp index 1a2d65947e..33c1e184b7 100644 --- a/src/gui/mrview/tool/tractography/tractography.cpp +++ b/src/gui/mrview/tool/tractography/tractography.cpp @@ -25,6 +25,8 @@ // as a fraction of the image FOV: #define MRTRIX_DEFAULT_LINE_THICKNESS 0.002f +#define MRTRIX_DEFAULT_POINT_SIZE 5.f + namespace MR { namespace GUI @@ -67,6 +69,7 @@ namespace MR Tractography::Tractography (Dock* parent) : Base (parent), line_thickness (MRTRIX_DEFAULT_LINE_THICKNESS), + point_size (MRTRIX_DEFAULT_POINT_SIZE), do_crop_to_slab (true), use_lighting (false), not_3D (true), @@ -424,6 +427,7 @@ namespace MR void Tractography::line_thickness_slot (int thickness) { line_thickness = MRTRIX_DEFAULT_LINE_THICKNESS * std::exp (2.0e-3f * thickness); + point_size = MRTRIX_DEFAULT_POINT_SIZE * std::exp (2.0e-3f * thickness); for (size_t i = 0, N = tractogram_list_model->rowCount(); i < N; ++i) { Tractogram* tractogram = dynamic_cast(tractogram_list_model->items[i].get()); @@ -742,6 +746,11 @@ namespace MR lighting_button->setEnabled (true); lighting_group_box->setEnabled (true); } + + if (geom_type == TrackGeometryType::Points) { + thickness_slider->setHidden (false); + thickness_label->setHidden (false); + } } diff --git a/src/gui/mrview/tool/tractography/tractography.h b/src/gui/mrview/tool/tractography/tractography.h index 4dc345259c..c0dbed3025 100644 --- a/src/gui/mrview/tool/tractography/tractography.h +++ b/src/gui/mrview/tool/tractography/tractography.h @@ -59,6 +59,7 @@ namespace MR QPushButton* hide_all_button; float line_thickness; + float point_size; bool do_crop_to_slab; bool use_lighting; bool use_threshold_scalarfile; From dca25c9c07227d749982ddf53a1bd56a904c2a64 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 8 Aug 2017 17:31:58 +1000 Subject: [PATCH 054/538] 5ttcheck: Relax and clarify warnings / errors Some users were alarmed by their 5TT images being reported as erroneous, when a single voxel did not have a unity sum of partial volume fractions (which really doesn't matter if it's a single voxel and the error is not too bad). This change relaxes from Exception to WARN() level the message when only a single voxel is erroneous. Furthermore, 5ttcheck will only return non-zero if one or more input images disobeys the fundamental 5TT requirements; if there are only warnings regarding non-unity sums of partial volume fractions, an additional warning will be isued at completion, but the command will still return zero. In addition, the -masks option behaviour depends on the usage: If a single input image only, the raw string will be used as the output image name if it constitutes a valid image name, otherwise ".mif" will be appended; only if there are multiple images will the name of the corresponding input file also be appended to the output image path. --- cmd/5ttcheck.cpp | 42 ++++++++++++++++++++++++++++++++++-------- core/formats/list.cpp | 4 ++-- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/cmd/5ttcheck.cpp b/cmd/5ttcheck.cpp index 4c4d81af71..530abb82b5 100644 --- a/cmd/5ttcheck.cpp +++ b/cmd/5ttcheck.cpp @@ -20,6 +20,7 @@ #include "algo/copy.h" #include "algo/loop.h" +#include "formats/list.h" #include "dwi/tractography/ACT/act.h" @@ -53,7 +54,7 @@ void run () { const std::string mask_prefix = get_option_value ("masks", ""); - size_t error_count = 0; + size_t major_error_count = 0, minor_error_count = 0; for (size_t i = 0; i != argument.size(); ++i) { auto in = Image::open (argument[i]); @@ -90,28 +91,53 @@ void run () } } - if (voxel_error_sum) { + if (voxel_error_sum == 1) { + INFO ("Image \"" + argument[i] + "\" contains just one isolated voxel with non-unity sum of partial volume fractions"); + } else if (voxel_error_sum) { WARN ("Image \"" + argument[i] + "\" contains " + str(voxel_error_sum) + " brain voxels with non-unity sum of partial volume fractions"); - ++error_count; + ++minor_error_count; if (voxels.valid()) { - auto out = Image::create (mask_prefix + Path::basename (argument[i]), H_out); + std::string path = mask_prefix; + if (argument.size() > 1) { + path += Path::basename (argument[i]); + } else { + bool has_extension = false; + for (auto p = MR::Formats::known_extensions; *p; ++p) { + if (Path::has_suffix (path, std::string (*p))) { + has_extension = true; + break; + } + } + if (!has_extension) + path += ".mif"; + } + auto out = Image::create (path, H_out); copy (voxels, out); } } else { INFO ("Image \"" + argument[i] + "\" conforms to 5TT format"); } - } catch (...) { + } catch (Exception& e) { + e.display(); WARN ("Image \"" + argument[i] + "\" does not conform to fundamental 5TT format requirements"); - ++error_count; + ++major_error_count; } } - if (error_count) { + const std::string vox_option_suggestion = get_options ("masks").size() ? (" (suggest checking " + std::string(argument.size() > 1 ? "outputs from" : "output of") + " -masks option)") : " (suggest re-running using the -masks option to see voxels where tissue fractions do not sum to 1.0)"; + + if (major_error_count) { if (argument.size() > 1) - throw Exception (str(error_count) + " input image" + (error_count > 1 ? "s do" : " does") + " not conform to 5TT format"); + throw Exception (str(major_error_count) + " input image" + (major_error_count > 1 ? "s do" : " does") + " not conform to 5TT format"); else throw Exception ("Input image does not conform to 5TT format"); + } else if (minor_error_count) { + if (argument.size() > 1) { + WARN (str(minor_error_count) + " input image" + (minor_error_count > 1 ? "s do" : " does") + " not perfectly conform to 5TT format, but may still be applicable" + vox_option_suggestion); + } else { + WARN ("Input image does not perfectly conform to 5TT format, but may still be applicable" + vox_option_suggestion); + } } } diff --git a/core/formats/list.cpp b/core/formats/list.cpp index 402df5ca4b..ffa4040764 100644 --- a/core/formats/list.cpp +++ b/core/formats/list.cpp @@ -58,7 +58,7 @@ namespace MR &mgh_handler, &mgz_handler, &mrtrix_sparse_handler, - NULL + nullptr }; @@ -79,7 +79,7 @@ namespace MR ".msf", ".msh", ".dcm", - NULL + nullptr }; } From 09c1f21fc7284708cb7da7458056f75045bea03c Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 10 Aug 2017 11:36:23 +1000 Subject: [PATCH 055/538] mrtrix3.app: Check presence of standard options before reading Some external applications may erase the standard options as defined in all MRtrix3 Python scripts; testing the values of these variables without first testing for their presence would therefore cause an error. --- lib/mrtrix3/app.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index 5dc7b80a95..56c1bd36bc 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -136,7 +136,7 @@ def parse(): args = cmdline.parse_args() - if args.help: + if hasattr(args, 'help') and args.help: cmdline._printHelp() sys.exit(0) @@ -152,20 +152,22 @@ def parse(): colourExec = '\033[03;36m' colourWarn = '\033[00;31m' - if args.nocleanup: + # Need to check for the presence of these keys first, since there's a chance that an external script may have + # erased the standard options + if hasattr(args, 'nocleanup') and args.nocleanup: _cleanup = False - if args.nthreads: + if hasattr(args, 'nthreads') and args.nthreads: _nthreads = args.nthreads - if args.quiet: + if hasattr(args, 'quiet') and args.quiet: _verbosity = 0 - elif args.info: + elif hasattr(args, 'info') and args.info: _verbosity = 2 - elif args.debug: + elif hasattr(args, 'debug') and args.debug: _verbosity = 3 cmdline.printCitationWarning() - if args.cont: + if hasattr(args, 'cont') and args.cont: _tempDir = os.path.abspath(args.cont[0]) _lastFile = args.cont[1] From ac7e73576bec4b6c5d42dc18c4cd34e02690bed0 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 10 Aug 2017 14:57:48 +1000 Subject: [PATCH 056/538] warpconvert: Make conversion type a compulsory argument --- cmd/mrcrop.cpp | 4 +-- cmd/warpconvert.cpp | 30 ++++++++----------- .../common_fba_steps/population_template2.rst | 2 +- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/cmd/mrcrop.cpp b/cmd/mrcrop.cpp index c7ccf4f18e..64f7d28a07 100644 --- a/cmd/mrcrop.cpp +++ b/cmd/mrcrop.cpp @@ -88,7 +88,7 @@ void run () overall_bounds[axis][1] = std::max (bounds[axis][1], overall_bounds[axis][1]); } } - void operator() (const decltype(mask)& m) { + void operator() (const decltype(mask)& m) { if (m.value()) { for (size_t axis = 0; axis != 3; ++axis) { bounds[axis][0] = std::min (bounds[axis][0], m.index(axis)); @@ -136,6 +136,6 @@ void run () auto cropped = Adapter::make (in, from, size); auto out = Image::create (argument[1], cropped); - threaded_copy_with_progress_message ("cropping image...", cropped, out); + threaded_copy_with_progress_message ("cropping image", cropped, out); } diff --git a/cmd/warpconvert.cpp b/cmd/warpconvert.cpp index 370368d54b..beaddfbe18 100644 --- a/cmd/warpconvert.cpp +++ b/cmd/warpconvert.cpp @@ -23,7 +23,7 @@ using namespace MR; using namespace App; -const char* conversion_type[] = {"deformation2displacement","displacement2deformation","warpfull2deformation","warpfull2displacement",NULL}; +const char* conversion_type[] = {"deformation2displacement","displacement2deformation","warpfull2deformation","warpfull2displacement",nullptr}; void usage () @@ -40,13 +40,10 @@ void usage () ARGUMENTS + Argument ("in", "the input warp image.").type_image_in () + + Argument ("type", "the conversion type required. Valid choices are: " + join(conversion_type, ", ")).type_choice (conversion_type) + Argument ("out", "the output warp image.").type_image_out (); OPTIONS - + Option ("type", "the conversion type required. Valid choices are: " - "deformation2displacement, displacement2deformation, warpfull2deformation, warpfull2displacement (Default: deformation2displacement)") - + Argument ("choice").type_choice (conversion_type) - + Option ("template", "define a template image when converting a warpfull file (which is defined on a grid in the midway space between image 1 & 2). For example to " "generate the deformation field that maps image1 to image2, then supply image2 as the template image") + Argument ("image").type_image_in () @@ -65,6 +62,7 @@ void usage () void run () { + const int conversion_type = argument[1]; bool midway_space = get_options("midway_space").size() ? true : false; std::string template_filename; @@ -77,13 +75,8 @@ void run () if (opt.size()) from = opt[0][0]; - int registration_type = 0; - opt = get_options ("type"); - if (opt.size()) - registration_type = opt[0][0]; - // deformation2displacement - if (registration_type == 0) { + if (conversion_type == 0) { if (midway_space) WARN ("-midway_space option ignored with deformation2displacement conversion type"); if (get_options ("template").size()) @@ -96,11 +89,11 @@ void run () Header header (deformation); header.datatype() = DataType::from_command_line (DataType::Float32); - Image displacement = Image::create (argument[1], header).with_direct_io(); + Image displacement = Image::create (argument[2], header).with_direct_io(); Registration::Warp::deformation2displacement (deformation, displacement); // displacement2deformation - } else if (registration_type == 1) { + } else if (conversion_type == 1) { auto displacement = Image::open (argument[0]).with_direct_io (3); Registration::Warp::check_warp (displacement); @@ -113,11 +106,11 @@ void run () Header header (displacement); header.datatype() = DataType::from_command_line (DataType::Float32); - Image deformation = Image::create (argument[1], header).with_direct_io(); + Image deformation = Image::create (argument[2], header).with_direct_io(); Registration::Warp::displacement2deformation (displacement, deformation); // warpfull2deformation & warpfull2displacement - } else if (registration_type == 2 || registration_type == 3) { + } else if (conversion_type == 2 || conversion_type == 3) { auto warp = Image::open (argument[0]).with_direct_io (3); Registration::Warp::check_warp_full (warp); @@ -132,13 +125,16 @@ void run () warp_output = Registration::Warp::compute_full_deformation (warp, template_header, from); } - if (registration_type == 3) + if (conversion_type == 3) Registration::Warp::deformation2displacement (warp_output, warp_output); Header header (warp_output); header.datatype() = DataType::from_command_line (DataType::Float32); - Image output = Image::create (argument[1], header); + Image output = Image::create (argument[2], header); threaded_copy_with_progress_message ("converting warp", warp_output, output); + + } else { + throw Exception ("Unsupported warp conversion type"); } } diff --git a/docs/fixel_based_analysis/common_fba_steps/population_template2.rst b/docs/fixel_based_analysis/common_fba_steps/population_template2.rst index 3a86eea0cb..5f2a42527d 100644 --- a/docs/fixel_based_analysis/common_fba_steps/population_template2.rst +++ b/docs/fixel_based_analysis/common_fba_steps/population_template2.rst @@ -15,4 +15,4 @@ conventional 4D deformation field format ready for the subsequent steps, run .. code-block:: console - $ foreach ../template/warps/* : warpconvert -type warpfull2deformation -template ../template/fod_template.mif IN PRE/subject2template_warp.mif + $ foreach ../template/warps/* : warpconvert -template ../template/fod_template.mif IN warpfull2deformation PRE/subject2template_warp.mif From fac2045fe59838eec8673b5725ab51aa5dc3fe5a Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 11 Aug 2017 15:29:00 +1000 Subject: [PATCH 057/538] New command: warpinvert This command calculates the inverse of a non-linear warp field. --- cmd/warpinvert.cpp | 79 +++++++++++++++++++++++++ docs/reference/commands/warpconvert.rst | 5 +- docs/reference/commands/warpinvert.rst | 70 ++++++++++++++++++++++ docs/reference/commands_list.rst | 6 +- 4 files changed, 155 insertions(+), 5 deletions(-) create mode 100644 cmd/warpinvert.cpp create mode 100644 docs/reference/commands/warpinvert.rst diff --git a/cmd/warpinvert.cpp b/cmd/warpinvert.cpp new file mode 100644 index 0000000000..0d59ab5b70 --- /dev/null +++ b/cmd/warpinvert.cpp @@ -0,0 +1,79 @@ +/* Copyright (c) 2008-2017 the MRtrix3 contributors. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * + * MRtrix is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * For more details, see http://www.mrtrix.org/. + */ + + +#include "command.h" +#include "datatype.h" +#include "header.h" +#include "image.h" +#include "registration/warp/helpers.h" +#include "registration/warp/invert.h" + + +using namespace MR; +using namespace App; + +void usage () +{ + AUTHOR = "Robert E. Smith (robert.smith@florey.edu.au) and David Raffelt (david.raffelt@florey.edu.au)"; + + SYNOPSIS = "Invert a non-linear warp field"; + + DESCRIPTION + + "By default, this command assumes that the input warp field is a deformation field, i.e. each voxel " + "stores the corresponding position in the other image (in scanner space), and the calculated output " + "warp image will also be a deformation field. If the input warp field is instead a displacment field, " + "i.e. where each voxel stores an offset from which to sample the other image (but still in scanner " + "space), then the -displacement option should be used; the output warp field will additionally be " + "calculated as a displacement field in this case."; + + ARGUMENTS + + Argument ("in", "the input warp image.").type_image_in () + + Argument ("out", "the output warp image.").type_image_out (); + + OPTIONS + + Option ("template", "define a template image grid for the output warp") + + Argument ("image").type_image_in () + + + Option ("displacement", "indicates that the input warp field is a displacement field; the output will also be a displacement field"); +} + + +void run () +{ + const bool displacement = get_options ("displacement").size(); + Header header_in (Header::open (argument[0])); + Registration::Warp::check_warp (header_in); + Header header_out (header_in); + auto opt = get_options ("template"); + if (opt.size()) { + header_out = Header::open (opt[0][0]); + if (displacement) { + header_out.ndim() = 3; + } else { + header_out.ndim() = 4; + header_out.size(3) = 3; + } + header_out.datatype() = DataType::Float32; + header_out.datatype().set_byte_order_native(); + } + + Image image_in (header_in.get_image()); + Image image_out (Image::create (argument[1], header_out)); + + if (displacement) { + Registration::Warp::invert_displacement (image_in, image_out); + } else { + Registration::Warp::invert_deformation (image_in, image_out); + } +} diff --git a/docs/reference/commands/warpconvert.rst b/docs/reference/commands/warpconvert.rst index 4be712a41d..0a492aba01 100644 --- a/docs/reference/commands/warpconvert.rst +++ b/docs/reference/commands/warpconvert.rst @@ -13,9 +13,10 @@ Usage :: - warpconvert [ options ] in out + warpconvert [ options ] in type out - *in*: the input warp image. +- *type*: the conversion type required. Valid choices are: deformation2displacement, displacement2deformation, warpfull2deformation, warpfull2displacement - *out*: the output warp image. Description @@ -26,8 +27,6 @@ A deformation field is defined as an image where each voxel defines the correspo Options ------- -- **-type choice** the conversion type required. Valid choices are: deformation2displacement, displacement2deformation, warpfull2deformation, warpfull2displacement (Default: deformation2displacement) - - **-template image** define a template image when converting a warpfull file (which is defined on a grid in the midway space between image 1 & 2). For example to generate the deformation field that maps image1 to image2, then supply image2 as the template image - **-midway_space** to be used only with warpfull2deformation and warpfull2displacement conversion types. The output will only contain the non-linear warp to map an input image to the midway space (defined by the warpfull grid). If a linear transform exists in the warpfull file header then it will be composed and included in the output. diff --git a/docs/reference/commands/warpinvert.rst b/docs/reference/commands/warpinvert.rst new file mode 100644 index 0000000000..208570184e --- /dev/null +++ b/docs/reference/commands/warpinvert.rst @@ -0,0 +1,70 @@ +.. _warpinvert: + +warpinvert +=================== + +Synopsis +-------- + +Invert a non-linear warp field + +Usage +-------- + +:: + + warpinvert [ options ] in out + +- *in*: the input warp image. +- *out*: the output warp image. + +Description +----------- + +By default, this command assumes that the input warp field is a deformation field, i.e. each voxel stores the corresponding position in the other image (in scanner space), and the calculated output warp image will also be a deformation field. If the input warp field is instead a displacment field, i.e. where each voxel stores an offset from which to sample the other image (but still in scanner space), then the -displacement option should be used; the output warp field will additionally be calculated as a displacement field in this case. + +Options +------- + +- **-template image** define a template image grid for the output warp + +- **-displacement** indicates that the input warp field is a displacement field; the output will also be a displacement field + +Standard options +^^^^^^^^^^^^^^^^ + +- **-info** display information messages. + +- **-quiet** do not display information messages or progress status. + +- **-debug** display debugging messages. + +- **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. + +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) + +- **-failonwarn** terminate program if a warning is produced + +- **-help** display this information page and exit. + +- **-version** display version information and exit. + +-------------- + + + +**Author:** Robert E. Smith (robert.smith@florey.edu.au) and David Raffelt (david.raffelt@florey.edu.au) + +**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. + +This Source Code Form is subject to the terms of the Mozilla Public +License, v. 2.0. If a copy of the MPL was not distributed with this +file, you can obtain one at http://mozilla.org/MPL/2.0/. + +MRtrix is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty +of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +For more details, see http://www.mrtrix.org/. + + diff --git a/docs/reference/commands_list.rst b/docs/reference/commands_list.rst index e2dda2196c..281901e74f 100644 --- a/docs/reference/commands_list.rst +++ b/docs/reference/commands_list.rst @@ -99,8 +99,8 @@ List of MRtrix3 commands commands/tcknormalise commands/tckresample commands/tcksample - commands/tcksift2 commands/tcksift + commands/tcksift2 commands/tckstats commands/tensor2metric commands/transformcalc @@ -117,6 +117,7 @@ List of MRtrix3 commands commands/warpconvert commands/warpcorrect commands/warpinit + commands/warpinvert .. csv-table:: @@ -210,8 +211,8 @@ List of MRtrix3 commands :ref:`tcknormalise`, "Apply a normalisation map to a tracks file" :ref:`tckresample`, "Resample each streamline in a track file to a new set of vertices" :ref:`tcksample`, "Sample values of an associated image along tracks" - :ref:`tcksift2`, "Successor to the SIFT method; instead of removing streamlines, use an EM framework to find an appropriate cross-section multiplier for each streamline" :ref:`tcksift`, "Filter a whole-brain fibre-tracking data set such that the streamline densities match the FOD lobe integrals" + :ref:`tcksift2`, "Successor to the SIFT method; instead of removing streamlines, use an EM framework to find an appropriate cross-section multiplier for each streamline" :ref:`tckstats`, "Calculate statistics on streamlines length" :ref:`tensor2metric`, "Generate maps of tensor-derived parameters" :ref:`transformcalc`, "Perform calculations on linear transformation matrices" @@ -228,3 +229,4 @@ List of MRtrix3 commands :ref:`warpconvert`, "Convert between different representations of a non-linear warp" :ref:`warpcorrect`, "Replaces voxels in a deformation field that point to 0,0,0 with nan,nan,nan" :ref:`warpinit`, "Create an initial warp image, representing an identity transformation" + :ref:`warpinvert`, "Invert a non-linear warp field" From f6297e91411707e54f994a6260f3bfcf3a310ed9 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 14 Aug 2017 11:05:25 +1000 Subject: [PATCH 058/538] labelsgmfix: Better check for FIRST completion Use same solution as that used in 5ttgen fsl algorithm for checking whether or not FIRST has completed, and acting accordingly depending on whether or not SGE is enabled. --- bin/labelsgmfix | 16 ++++++++++++---- lib/mrtrix3/_5ttgen/fsl.py | 4 ++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/bin/labelsgmfix b/bin/labelsgmfix index b1488b5913..beee57e4e9 100755 --- a/bin/labelsgmfix +++ b/bin/labelsgmfix @@ -60,7 +60,7 @@ if not os.path.isdir(first_atlas_path): # Want a mapping between FreeSurfer node names and FIRST structure names # Just deal with the 5 that are used in ACT; FreeSurfer's hippocampus / amygdala segmentations look good enough. -structure_map = { 'L_Accu':'Left-Accumbens-area', 'R_Accu':'Right-Accumbens-area', +structure_map = { 'L_Accu':'Left-Accumbens-area', 'R_Accu':'Right-Accumbens-area', 'L_Caud':'Left-Caudate', 'R_Caud':'Right-Caudate', 'L_Pall':'Left-Pallidum', 'R_Pall':'Right-Pallidum', 'L_Puta':'Left-Putamen', 'R_Puta':'Right-Putamen', @@ -81,7 +81,17 @@ app.gotoTempDir() first_input_is_brain_extracted = '' if app.args.premasked: first_input_is_brain_extracted = ' -b' -run.command(first_cmd + ' -s ' + ','.join(structure_map.keys()) + ' -i T1.nii' + first_input_is_brain_extracted + ' -o first') +run.command(first_cmd + ' -m none -s ' + ','.join(structure_map.keys()) + ' -i T1.nii' + first_input_is_brain_extracted + ' -o first') + +# Check output of FIRST, just as is done in 5ttgen fsl +combined_image_path = 'first_all_none_firstseg' + fsl_suffix +if not os.path.isfile(combined_image_path): + if 'SGE_ROOT' in os.environ: + app.console('FSL FIRST job has been submitted to SGE; awaiting completion') + app.console('(note however that FIRST may fail silently, and hence this script may hang indefinitely)') + file.waitFor(combined_image_path) + else: + app.error('FSL FIRST has failed; not all structures were segmented successfully (check ' + path.toTemp('first.logs', False) + ')') # Generate an empty image that will be used to contruct the new SGM nodes run.command('mrcalc parc.mif 0 -min sgm.mif') @@ -105,8 +115,6 @@ for key, value in structure_map.items(): image_path = key + '_mask.mif' mask_list.append(image_path) vtk_in_path = 'first-' + key + '_first.vtk' - if not os.path.exists(vtk_in_path): - app.error('Missing .vtk file for structure ' + struct + '; run_first_all must have failed') run.command('meshconvert ' + vtk_in_path + ' first-' + key + '_transformed.vtk -transform first2real T1.nii') run.command('mesh2pve first-' + key + '_transformed.vtk parc.mif - | mrthreshold - ' + image_path + ' -abs 0.5') # Add to the SGM image; don't worry about overlap for now diff --git a/lib/mrtrix3/_5ttgen/fsl.py b/lib/mrtrix3/_5ttgen/fsl.py index 65f46e854a..3202e77e26 100644 --- a/lib/mrtrix3/_5ttgen/fsl.py +++ b/lib/mrtrix3/_5ttgen/fsl.py @@ -178,7 +178,7 @@ def execute(): first_input_brain_extracted_option = '' if app.args.premasked: first_input_brain_extracted_option = ' -b' - run.command(first_cmd + ' -s ' + ','.join(sgm_structures) + ' -i ' + first_input + ' -o first' + first_input_brain_extracted_option) + run.command(first_cmd + ' -m none -s ' + ','.join(sgm_structures) + ' -i ' + first_input + ' -o first' + first_input_brain_extracted_option) # Test to see whether or not FIRST has succeeded # However if the expected image is absent, it may be due to FIRST being run @@ -188,7 +188,7 @@ def execute(): if not os.path.isfile(combined_image_path): if 'SGE_ROOT' in os.environ: app.console('FSL FIRST job has been submitted to SGE; awaiting completion') - app.console('(note however that FIRST may fail, and hence this script may hang indefinitely)') + app.console('(note however that FIRST may fail silently, and hence this script may hang indefinitely)') file.waitFor(combined_image_path) else: app.error('FSL FIRST has failed; not all structures were segmented successfully (check ' + path.toTemp('first.logs', False) + ')') From 73e21b47c1bd7b93bd7b0ae67864c49727be9d08 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 14 Aug 2017 14:51:43 +1000 Subject: [PATCH 059/538] Alter warnings for non-uint parcellation images Previously, the user would be warned if their parcellation image was not an unsigned integer. This was perhaps too draconian, as many image formats do not support unsigned integer types. Instead, such images will now be checked explicitly, and the message reported at CONSOLE level rather than WARN. I had actually already written code for performing this check, but had commented it out, since moving the IO handler from the Header to the test Image class would result in destruction of the IO class once the test was complete; now, the image is opened for testing independently of the input Header (which should remain const, and retain its existing IO handler). --- src/connectome/connectome.cpp | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/connectome/connectome.cpp b/src/connectome/connectome.cpp index 7ae7e4b03a..d8c02ac719 100644 --- a/src/connectome/connectome.cpp +++ b/src/connectome/connectome.cpp @@ -14,6 +14,7 @@ #include "connectome/connectome.h" +#include "header.h" #include "image.h" #include "algo/loop.h" @@ -33,19 +34,26 @@ namespace MR { void check (const Header& H) { if (H.datatype().is_floating_point()) { - // auto test = H.get_image(); - // for (auto l = Loop(test) (test); l; ++l) { - // if (std::round (float(test.value())) != test.value()) - // throw Exception ("Floating-point number detected in image \"" + H.name() + "\"; label images should contain integers only"); - // } - WARN ("Image \"" + H.name() + "\" stored as floating-point; it is preferable to store label images using an unsigned integer type"); + CONSOLE ("Image \"" + H.name() + "\" stored with floating-point type; need to check for non-integer or negative values"); + // Need to open the image WITHOUT using the IO handler stored in H; + // creating an image from this "claims" the handler from the header, and + // therefore once this check has completed the image can no longer be opened + auto test = Image::open (H.name()); + for (auto l = Loop("Verifying parcellation image", test) (test); l; ++l) { + if (std::round (float(test.value())) != test.value()) + throw Exception ("Floating-point number detected in image \"" + H.name() + "\"; label images should contain integers only"); + if (float(test.value()) < 0.0f) + throw Exception ("Negative value detected in image \"" + H.name() + "\"; label images should be strictly non-negative"); + } + //WARN ("Image \"" + H.name() + "\" stored as floating-point; it is preferable to store label images using an unsigned integer type"); } else if (H.datatype().is_signed()) { - // auto test = H.get_image(); - // for (auto l = Loop(test) (test); l; ++l) { - // if (int64_t(test.value()) < int64_t(0)) - // throw Exception ("Negative values detected in image \"" + H.name() + "\"; label images should be strictly non-negative"); - // } - WARN ("Image \"" + H.name() + "\" stored as signed integer; it is preferable to store label images using an unsigned integer type"); + CONSOLE ("Image \"" + H.name() + "\" stored with signed integer type; need to check for negative values"); + auto test = Image::open (H.name()); + for (auto l = Loop("Verifying parcellation image", test) (test); l; ++l) { + if (int64_t(test.value()) < int64_t(0)) + throw Exception ("Negative value detected in image \"" + H.name() + "\"; label images should be strictly non-negative"); + } + //WARN ("Image \"" + H.name() + "\" stored as signed integer; it is preferable to store label images using an unsigned integer type"); } } From 3d0e89fc836848d285465e669d07a892d22912c6 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 14 Aug 2017 16:17:03 +1000 Subject: [PATCH 060/538] mrcalc: Add missing NOMEMALIGN macro --- cmd/mrcalc.cpp | 142 ++++++++++++++++++++++++------------------------- 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/cmd/mrcalc.cpp b/cmd/mrcalc.cpp index 96632e435c..50470efa6f 100644 --- a/cmd/mrcalc.cpp +++ b/cmd/mrcalc.cpp @@ -35,7 +35,7 @@ DESCRIPTION + "This command will only compute per-voxel operations. " "Use 'mrmath' to compute summary statistics across images or " "along image axes." - + + "This command uses a stack-based syntax, with operators " "(specified using options) operating on the top-most entries " "(i.e. images or values) in the stack. Operands (values or " @@ -44,20 +44,20 @@ DESCRIPTION "as options) operate on and consume the top-most entries in " "the stack, and push their output as a new entry on the stack. " "For example:" - + + " $ mrcalc a.mif 2 -mult r.mif" - + + "performs the operation r = 2*a for every voxel a,r in " "images a.mif and r.mif respectively. Similarly:" - + + " $ mrcalc a.mif -neg b.mif -div -exp 9.3 -mult r.mif" - + + "performs the operation r = 9.3*exp(-a/b), and:" - + + " $ mrcalc a.mif b.mif -add c.mif d.mif -mult 4.2 -add -div r.mif" - + + "performs r = (a+b)/(c*d+4.2)." - + + "As an additional feature, this command will allow images with different " "dimensions to be processed, provided they satisfy the following " "conditions: for each axis, the dimensions match if they are the same size, " @@ -214,15 +214,15 @@ class LoadedImage { NOMEMALIGN class StackEntry { NOMEMALIGN public: - StackEntry (const char* entry) : + StackEntry (const char* entry) : arg (entry) { } - StackEntry (Evaluator* evaluator_p) : + StackEntry (Evaluator* evaluator_p) : arg (nullptr), evaluator (evaluator_p) { } void load () { - if (!arg) + if (!arg) return; auto search = image_list.find (arg); if (search != image_list.end()) { @@ -243,8 +243,8 @@ class StackEntry { NOMEMALIGN else if (a == "-nan") { value = -std::numeric_limits::quiet_NaN(); } else if (a == "inf") { value = std::numeric_limits::infinity(); } else if (a == "-inf") { value = -std::numeric_limits::infinity(); } - else if (a == "rand") { value = 0.0; rng.reset (new Math::RNG()); rng_gausssian = false; } - else if (a == "randn") { value = 0.0; rng.reset (new Math::RNG()); rng_gausssian = true; } + else if (a == "rand") { value = 0.0; rng.reset (new Math::RNG()); rng_gausssian = false; } + else if (a == "randn") { value = 0.0; rng.reset (new Math::RNG()); rng_gausssian = true; } else { value = to (arg); } } } @@ -270,8 +270,8 @@ std::map StackEntry::image_list; class Evaluator { NOMEMALIGN - public: - Evaluator (const std::string& name, const char* format_string, bool complex_maps_to_real = false, bool real_maps_to_complex = false) : + public: + Evaluator (const std::string& name, const char* format_string, bool complex_maps_to_real = false, bool real_maps_to_complex = false) : id (name), format (format_string), ZtoR (complex_maps_to_real), @@ -295,8 +295,8 @@ class Evaluator { NOMEMALIGN virtual Chunk& evaluate (Chunk& a, Chunk& b, Chunk& c) const { throw Exception ("operation \"" + id + "\" not supported!"); return a; } virtual bool is_complex () const { - for (size_t n = 0; n < operands.size(); ++n) - if (operands[n].is_complex()) + for (size_t n = 0; n < operands.size(); ++n) + if (operands[n].is_complex()) return !ZtoR; return RtoZ; } @@ -361,7 +361,7 @@ inline void replace (std::string& orig, size_t n, const std::string& value) // to make sure full operation is recorded, even for scalar operations that // get evaluated there and then and so get left out if the string is created // later: -std::string operation_string (const StackEntry& entry) +std::string operation_string (const StackEntry& entry) { if (entry.image) return entry.image->name(); @@ -369,7 +369,7 @@ std::string operation_string (const StackEntry& entry) return entry.rng_gausssian ? "randn()" : "rand()"; else if (entry.evaluator) { std::string s = entry.evaluator->format; - for (size_t n = 0; n < entry.evaluator->operands.size(); ++n) + for (size_t n = 0; n < entry.evaluator->operands.size(); ++n) replace (s, n, operation_string (entry.evaluator->operands[n])); return s; } @@ -383,23 +383,23 @@ std::string operation_string (const StackEntry& entry) template class UnaryEvaluator : public Evaluator { NOMEMALIGN public: - UnaryEvaluator (const std::string& name, Operation operation, const StackEntry& operand) : - Evaluator (name, operation.format, operation.ZtoR, operation.RtoZ), - op (operation) { + UnaryEvaluator (const std::string& name, Operation operation, const StackEntry& operand) : + Evaluator (name, operation.format, operation.ZtoR, operation.RtoZ), + op (operation) { operands.push_back (operand); } Operation op; - virtual Chunk& evaluate (Chunk& in) const { - if (operands[0].is_complex()) + virtual Chunk& evaluate (Chunk& in) const { + if (operands[0].is_complex()) for (size_t n = 0; n < in.size(); ++n) in[n] = op.Z (in[n]); - else + else for (size_t n = 0; n < in.size(); ++n) in[n] = op.R (in[n].real()); - return in; + return in; } }; @@ -411,9 +411,9 @@ class UnaryEvaluator : public Evaluator { NOMEMALIGN template class BinaryEvaluator : public Evaluator { NOMEMALIGN public: - BinaryEvaluator (const std::string& name, Operation operation, const StackEntry& operand1, const StackEntry& operand2) : + BinaryEvaluator (const std::string& name, Operation operation, const StackEntry& operand1, const StackEntry& operand2) : Evaluator (name, operation.format, operation.ZtoR, operation.RtoZ), - op (operation) { + op (operation) { operands.push_back (operand1); operands.push_back (operand2); } @@ -423,15 +423,15 @@ class BinaryEvaluator : public Evaluator { NOMEMALIGN virtual Chunk& evaluate (Chunk& a, Chunk& b) const { Chunk& out (a.size() ? a : b); if (operands[0].is_complex() || operands[1].is_complex()) { - for (size_t n = 0; n < out.size(); ++n) + for (size_t n = 0; n < out.size(); ++n) out[n] = op.Z ( - a.size() ? a[n] : a.value, + a.size() ? a[n] : a.value, b.size() ? b[n] : b.value ); } else { - for (size_t n = 0; n < out.size(); ++n) + for (size_t n = 0; n < out.size(); ++n) out[n] = op.R ( - a.size() ? a[n].real() : a.value.real(), + a.size() ? a[n].real() : a.value.real(), b.size() ? b[n].real() : b.value.real() ); } return out; @@ -444,9 +444,9 @@ class BinaryEvaluator : public Evaluator { NOMEMALIGN template class TernaryEvaluator : public Evaluator { NOMEMALIGN public: - TernaryEvaluator (const std::string& name, Operation operation, const StackEntry& operand1, const StackEntry& operand2, const StackEntry& operand3) : + TernaryEvaluator (const std::string& name, Operation operation, const StackEntry& operand1, const StackEntry& operand2, const StackEntry& operand3) : Evaluator (name, operation.format, operation.ZtoR, operation.RtoZ), - op (operation) { + op (operation) { operands.push_back (operand1); operands.push_back (operand2); operands.push_back (operand3); @@ -457,17 +457,17 @@ class TernaryEvaluator : public Evaluator { NOMEMALIGN virtual Chunk& evaluate (Chunk& a, Chunk& b, Chunk& c) const { Chunk& out (a.size() ? a : (b.size() ? b : c)); if (operands[0].is_complex() || operands[1].is_complex() || operands[2].is_complex()) { - for (size_t n = 0; n < out.size(); ++n) + for (size_t n = 0; n < out.size(); ++n) out[n] = op.Z ( a.size() ? a[n] : a.value, b.size() ? b[n] : b.value, c.size() ? c[n] : c.value ); } else { - for (size_t n = 0; n < out.size(); ++n) + for (size_t n = 0; n < out.size(); ++n) out[n] = op.R ( - a.size() ? a[n].real() : a.value.real(), - b.size() ? b[n].real() : b.value.real(), + a.size() ? a[n].real() : a.value.real(), + b.size() ? b[n].real() : b.value.real(), c.size() ? c[n].real() : c.value.real() ); } return out; @@ -482,7 +482,7 @@ class TernaryEvaluator : public Evaluator { NOMEMALIGN template void unary_operation (const std::string& operation_name, vector& stack, Operation operation) { - if (stack.empty()) + if (stack.empty()) throw Exception ("no operand in stack for operation \"" + operation_name + "\"!"); StackEntry& a (stack[stack.size()-1]); a.load(); @@ -507,7 +507,7 @@ void unary_operation (const std::string& operation_name, vector& sta template void binary_operation (const std::string& operation_name, vector& stack, Operation operation) { - if (stack.size() < 2) + if (stack.size() < 2) throw Exception ("not enough operands in stack for operation \"" + operation_name + "\""); StackEntry& a (stack[stack.size()-2]); StackEntry& b (stack[stack.size()-1]); @@ -519,7 +519,7 @@ void binary_operation (const std::string& operation_name, vector& st stack.back() = entry; } else { - a.value = ( a.value.imag() == 0.0 && b.value.imag() == 0.0 ? + a.value = ( a.value.imag() == 0.0 && b.value.imag() == 0.0 ? operation.R (a.value.real(), b.value.real()) : operation.Z (a.value, b.value) ); stack.pop_back(); @@ -532,7 +532,7 @@ void binary_operation (const std::string& operation_name, vector& st template void ternary_operation (const std::string& operation_name, vector& stack, Operation operation) { - if (stack.size() < 3) + if (stack.size() < 3) throw Exception ("not enough operands in stack for operation \"" + operation_name + "\""); StackEntry& a (stack[stack.size()-3]); StackEntry& b (stack[stack.size()-2]); @@ -547,7 +547,7 @@ void ternary_operation (const std::string& operation_name, vector& s stack.back() = entry; } else { - a.value = ( a.value.imag() == 0.0 && b.value.imag() == 0.0 && c.value.imag() == 0.0 ? + a.value = ( a.value.imag() == 0.0 && b.value.imag() == 0.0 && c.value.imag() == 0.0 ? operation.R (a.value.real(), b.value.real(), c.value.real()) : operation.Z (a.value, b.value, c.value) ); stack.pop_back(); @@ -564,7 +564,7 @@ void ternary_operation (const std::string& operation_name, vector& s **********************************************************************/ -void get_header (const StackEntry& entry, Header& header) +void get_header (const StackEntry& entry, Header& header) { if (entry.evaluator) { for (size_t n = 0; n < entry.evaluator->operands.size(); ++n) @@ -572,7 +572,7 @@ void get_header (const StackEntry& entry, Header& header) return; } - if (!entry.image) + if (!entry.image) return; if (header.ndim() == 0) { @@ -580,7 +580,7 @@ void get_header (const StackEntry& entry, Header& header) return; } - if (header.ndim() < entry.image->ndim()) + if (header.ndim() < entry.image->ndim()) header.ndim() = entry.image->ndim(); for (size_t n = 0; n < std::min (header.ndim(), entry.image->ndim()); ++n) { if (header.size(n) > 1 && entry.image->size(n) > 1 && header.size(n) != entry.image->size(n)) @@ -590,7 +590,7 @@ void get_header (const StackEntry& entry, Header& header) transform_mis_match_reported = true; } header.size(n) = std::max (header.size(n), entry.image->size(n)); - if (!std::isfinite (header.spacing(n))) + if (!std::isfinite (header.spacing(n))) header.spacing(n) = entry.image->spacing(n); } @@ -622,7 +622,7 @@ class ThreadFunctor { NOMEMALIGN public: ThreadFunctor ( const vector& inner_axes, - const StackEntry& top_of_stack, + const StackEntry& top_of_stack, Image& output_image) : top_entry (top_of_stack), image (output_image), @@ -661,7 +661,7 @@ class ThreadFunctor { NOMEMALIGN Chunk& chunk = top_entry.evaluate (storage); auto value = chunk.cbegin(); - for (auto l = loop (image); l; ++l) + for (auto l = loop (image); l; ++l) image.value() = *(value++); } @@ -678,14 +678,14 @@ class ThreadFunctor { NOMEMALIGN -void run_operations (const vector& stack) +void run_operations (const vector& stack) { Header header; get_header (stack[0], header); if (header.ndim() == 0) { DEBUG ("no valid images supplied - assuming calculator mode"); - if (stack.size() != 1) + if (stack.size() != 1) throw Exception ("too many operands left on stack!"); assert (!stack[0].evaluator); @@ -695,10 +695,10 @@ void run_operations (const vector& stack) return; } - if (stack.size() == 1) + if (stack.size() == 1) throw Exception ("output image not specified"); - if (stack.size() > 2) + if (stack.size() > 2) throw Exception ("too many operands left on stack!"); if (!stack[1].arg) @@ -786,7 +786,7 @@ class OpNeg : public OpUnary { NOMEMALIGN class OpSqrt : public OpUnary { NOMEMALIGN public: - OpSqrt () : OpUnary ("sqrt (%1)") { } + OpSqrt () : OpUnary ("sqrt (%1)") { } complex_type R (real_type v) const { return std::sqrt (v); } complex_type Z (complex_type v) const { return std::sqrt (v); } }; @@ -814,14 +814,14 @@ class OpLog10 : public OpUnary { NOMEMALIGN class OpCos : public OpUnary { NOMEMALIGN public: - OpCos () : OpUnary ("cos (%1)") { } + OpCos () : OpUnary ("cos (%1)") { } complex_type R (real_type v) const { return std::cos (v); } complex_type Z (complex_type v) const { return std::cos (v); } }; class OpSin : public OpUnary { NOMEMALIGN public: - OpSin () : OpUnary ("sin (%1)") { } + OpSin () : OpUnary ("sin (%1)") { } complex_type R (real_type v) const { return std::sin (v); } complex_type Z (complex_type v) const { return std::sin (v); } }; @@ -849,7 +849,7 @@ class OpSinh : public OpUnary { NOMEMALIGN class OpTanh : public OpUnary { NOMEMALIGN public: - OpTanh () : OpUnary ("tanh (%1)") { } + OpTanh () : OpUnary ("tanh (%1)") { } complex_type R (real_type v) const { return std::tanh (v); } complex_type Z (complex_type v) const { return std::tanh (v); } }; @@ -862,7 +862,7 @@ class OpAcos : public OpUnary { NOMEMALIGN class OpAsin : public OpUnary { NOMEMALIGN public: - OpAsin () : OpUnary ("asin (%1)") { } + OpAsin () : OpUnary ("asin (%1)") { } complex_type R (real_type v) const { return std::asin (v); } }; @@ -874,7 +874,7 @@ class OpAtan : public OpUnary { NOMEMALIGN class OpAcosh : public OpUnary { NOMEMALIGN public: - OpAcosh () : OpUnary ("acosh (%1)") { } + OpAcosh () : OpUnary ("acosh (%1)") { } complex_type R (real_type v) const { return std::acosh (v); } }; @@ -893,13 +893,13 @@ class OpAtanh : public OpUnary { NOMEMALIGN class OpRound : public OpUnary { NOMEMALIGN public: - OpRound () : OpUnary ("round (%1)") { } + OpRound () : OpUnary ("round (%1)") { } complex_type R (real_type v) const { return std::round (v); } }; class OpCeil : public OpUnary { NOMEMALIGN public: - OpCeil () : OpUnary ("ceil (%1)") { } + OpCeil () : OpUnary ("ceil (%1)") { } complex_type R (real_type v) const { return std::ceil (v); } }; @@ -929,7 +929,7 @@ class OpPhase : public OpUnary { NOMEMALIGN class OpConj : public OpUnary { NOMEMALIGN public: - OpConj () : OpUnary ("conj (%1)") { } + OpConj () : OpUnary ("conj (%1)") { } complex_type Z (complex_type v) const { return std::conj (v); } }; @@ -961,14 +961,14 @@ class OpFinite : public OpUnary { NOMEMALIGN class OpAdd : public OpBinary { NOMEMALIGN public: - OpAdd () : OpBinary ("(%1 + %2)") { } + OpAdd () : OpBinary ("(%1 + %2)") { } complex_type R (real_type a, real_type b) const { return a+b; } complex_type Z (complex_type a, complex_type b) const { return a+b; } }; class OpSubtract : public OpBinary { NOMEMALIGN public: - OpSubtract () : OpBinary ("(%1 - %2)") { } + OpSubtract () : OpBinary ("(%1 - %2)") { } complex_type R (real_type a, real_type b) const { return a-b; } complex_type Z (complex_type a, complex_type b) const { return a-b; } }; @@ -982,7 +982,7 @@ class OpMultiply : public OpBinary { NOMEMALIGN class OpDivide : public OpBinary { NOMEMALIGN public: - OpDivide () : OpBinary ("(%1 / %2)") { } + OpDivide () : OpBinary ("(%1 / %2)") { } complex_type R (real_type a, real_type b) const { return a/b; } complex_type Z (complex_type a, complex_type b) const { return a/b; } }; @@ -1002,7 +1002,7 @@ class OpMin : public OpBinary { NOMEMALIGN class OpMax : public OpBinary { NOMEMALIGN public: - OpMax () : OpBinary ("max (%1, %2)") { } + OpMax () : OpBinary ("max (%1, %2)") { } complex_type R (real_type a, real_type b) const { return std::max (a, b); } }; @@ -1014,7 +1014,7 @@ class OpLessThan : public OpBinary { NOMEMALIGN class OpGreaterThan : public OpBinary { NOMEMALIGN public: - OpGreaterThan () : OpBinary ("(%1 > %2)") { } + OpGreaterThan () : OpBinary ("(%1 > %2)") { } complex_type R (real_type a, real_type b) const { return a > b; } }; @@ -1026,7 +1026,7 @@ class OpLessThanOrEqual : public OpBinary { NOMEMALIGN class OpGreaterThanOrEqual : public OpBinary { NOMEMALIGN public: - OpGreaterThanOrEqual () : OpBinary ("(%1 >= %2)") { } + OpGreaterThanOrEqual () : OpBinary ("(%1 >= %2)") { } complex_type R (real_type a, real_type b) const { return a >= b; } }; @@ -1067,7 +1067,7 @@ class OpIf : public OpTernary { NOMEMALIGN complex_type Z (complex_type a, complex_type b, complex_type c) const { return a.real() ? b : c; } }; -class OpReplace : public OpTernary { +class OpReplace : public OpTernary { NOMEMALIGN public: OpReplace () : OpTernary ("(%1, %2 -> %3)") { } complex_type R (real_type a, real_type b, real_type c) const { return ((a==b) || (std::isnan(a) && std::isnan(b))) ? c : a; } @@ -1087,7 +1087,7 @@ void run () { const Option* opt = match_option (App::argv[n]); if (opt) { - if (opt->is ("abs")) unary_operation (opt->id, stack, OpAbs()); + if (opt->is ("abs")) unary_operation (opt->id, stack, OpAbs()); else if (opt->is ("neg")) unary_operation (opt->id, stack, OpNeg()); else if (opt->is ("sqrt")) unary_operation (opt->id, stack, OpSqrt()); else if (opt->is ("exp")) unary_operation (opt->id, stack, OpExp()); @@ -1148,7 +1148,7 @@ void run () { else if (opt->is ("force") || opt->is ("info") || opt->is ("debug") || opt->is ("quiet")) continue; - else + else throw Exception (std::string ("operation \"") + opt->id + "\" not yet implemented!"); } From 9bdba675c4ccf7f1303d1f5606c22b8abb89cf0a Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 15 Aug 2017 09:48:34 +1000 Subject: [PATCH 061/538] Multiple minor fixes - dwigradcheck: Fix automatic mask calculation when gradient table is provided manually at the command-line and not embedded within the image header - mrtransform: Revert changes related to oversampling when using nearest-neighbour interpolation (the default of no oversampling in this case is now set when the new -oversample command-line option is parsed). - tck2connectome: Remove redundant -zero_diagonal option (this is part of MR::Connectome::MatrixOutputOptions). - tck2connectome: More verbose error message for erroneous usage of the -scale_file option. --- bin/dwigradcheck | 6 +++--- cmd/mrtransform.cpp | 2 +- cmd/tck2connectome.cpp | 5 ----- docs/reference/commands/tck2connectome.rst | 2 -- src/dwi/tractography/connectome/connectome.cpp | 10 ++++++++-- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/bin/dwigradcheck b/bin/dwigradcheck index bcbb971433..beddf29339 100755 --- a/bin/dwigradcheck +++ b/bin/dwigradcheck @@ -89,16 +89,16 @@ if not len(grad_mrtrix) == num_volumes: if not len(grad_fsl) == 3 or not len(grad_fsl[0]) == num_volumes: app.error('Internal error (inconsistent gradient table storage)') - + # Generate a brain mask if we weren't provided with one if not os.path.exists('mask.mif'): - run.command('dwi2mask data.mif mask.mif') + run.command('dwi2mask data.mif mask.mif -grad grad.b') # How many tracks are we going to generate? number_option = ' -select ' + str(app.args.number) -# +# # TODO What variations of gradient errors can we conceive? # Done: diff --git a/cmd/mrtransform.cpp b/cmd/mrtransform.cpp index 472d78459a..4bb7f1fdd6 100644 --- a/cmd/mrtransform.cpp +++ b/cmd/mrtransform.cpp @@ -508,7 +508,7 @@ void run () switch (interp) { case 0: - Filter::reslice (input, output, linear_transform, { 1, 1, 1 }, out_of_bounds_value); + Filter::reslice (input, output, linear_transform, oversample, out_of_bounds_value); break; case 1: Filter::reslice (input, output, linear_transform, oversample, out_of_bounds_value); diff --git a/cmd/tck2connectome.cpp b/cmd/tck2connectome.cpp index 34d9809d62..900137b5d6 100644 --- a/cmd/tck2connectome.cpp +++ b/cmd/tck2connectome.cpp @@ -69,11 +69,6 @@ void usage () "this can be used subsequently e.g. by the command connectome2tck") + Argument ("path").type_file_out() - + Option ("zero_diagonal", "set all diagonal entries in the matrix to zero \n" - "(these represent streamlines that connect to the same node at both ends)") - - // TODO Option to make matrix symmetric before output - + Option ("vector", "output a vector representing connectivities from a given seed point to target nodes, " "rather than a matrix of node-node connectivities"); diff --git a/docs/reference/commands/tck2connectome.rst b/docs/reference/commands/tck2connectome.rst index de6bf80d1e..07d6cc27dd 100644 --- a/docs/reference/commands/tck2connectome.rst +++ b/docs/reference/commands/tck2connectome.rst @@ -64,8 +64,6 @@ Other options for tck2connectome - **-out_assignments path** output the node assignments of each streamline to a file; this can be used subsequently e.g. by the command connectome2tck -- **-zero_diagonal** set all diagonal entries in the matrix to zero (these represent streamlines that connect to the same node at both ends) - - **-vector** output a vector representing connectivities from a given seed point to target nodes, rather than a matrix of node-node connectivities Standard options diff --git a/src/dwi/tractography/connectome/connectome.cpp b/src/dwi/tractography/connectome/connectome.cpp index ea2b08f9da..5064f3d06f 100644 --- a/src/dwi/tractography/connectome/connectome.cpp +++ b/src/dwi/tractography/connectome/connectome.cpp @@ -117,8 +117,14 @@ void setup_metric (Metric& metric, Image& nodes_data) if (get_options ("scale_invnodevol").size()) metric.set_scale_invnodevol (nodes_data); auto opt = get_options ("scale_file"); - if (opt.size()) - metric.set_scale_file (opt[0][0]); + if (opt.size()) { + try { + metric.set_scale_file (opt[0][0]); + } catch (Exception& e) { + throw Exception (e, "-scale_file option expects a file containing a list of numbers (one for each streamline); " + "file \"" + std::string(opt[0][0]) + "\" does not appear to contain this"); + } + } } From c4952986c5887a628b1e1ac20eaaa923e6ec6b13 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 15 Aug 2017 11:13:34 +1000 Subject: [PATCH 062/538] Scripts: Fix residual errors after branch merging --- bin/dwigradcheck | 10 +++++----- bin/dwipreproc | 11 +++++------ bin/labelsgmfix | 5 ++--- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/bin/dwigradcheck b/bin/dwigradcheck index bcbb971433..04c0362dd0 100755 --- a/bin/dwigradcheck +++ b/bin/dwigradcheck @@ -10,7 +10,7 @@ if not os.path.isdir(lib_folder): sys.exit(1) sys.path.insert(0, lib_folder) -import copy, decimal, numbers, os, sys, shutil +import copy, decimal, numbers, shutil from mrtrix3 import app, image, run, path app.init('Robert E. Smith (robert.smith@florey.edu.au)', 'Check the orientation of the diffusion gradient table') @@ -33,11 +33,11 @@ app.cmdline.flagMutuallyExclusiveOptions( ['grad', 'fslgrad' ]) app.cmdline.flagMutuallyExclusiveOptions( ['export_grad_mrtrix', 'export_grad_fsl' ]) app.parse() -image_dimensions = [ int(i) for i in image.headerField(app.args.input, 'size').split() ] +image_dimensions = image.header(path.fromUser(app.args.input, False)).size if len(image_dimensions) != 4: app.error('Input image must be a 4D image') if min(image_dimensions) == 1: - app.error('Cannot perform tractography on an image with a unity spatial dimension') + app.error('Cannot perform tractography on an image with a unity dimension') num_volumes = image_dimensions[3] app.makeTempDir() @@ -89,7 +89,7 @@ if not len(grad_mrtrix) == num_volumes: if not len(grad_fsl) == 3 or not len(grad_fsl[0]) == num_volumes: app.error('Internal error (inconsistent gradient table storage)') - + # Generate a brain mask if we weren't provided with one if not os.path.exists('mask.mif'): run.command('dwi2mask data.mif mask.mif') @@ -98,7 +98,7 @@ if not os.path.exists('mask.mif'): number_option = ' -select ' + str(app.args.number) -# +# # TODO What variations of gradient errors can we conceive? # Done: diff --git a/bin/dwipreproc b/bin/dwipreproc index cdfde99855..dbe7236eb2 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -23,7 +23,6 @@ if not os.path.isdir(lib_folder): sys.path.insert(0, lib_folder) import math -from distutils.spawn import find_executable from mrtrix3 import app, file, fsl, image, path, phaseEncoding, run @@ -461,11 +460,11 @@ if do_topup: output_path = 'dwi_pe_' + str(index) + '_topup.mif' run.command('dwiextract dwi.mif' + import_dwi_pe_table_option + ' -pe ' + ','.join(line.split()) + ' - | mrconvert - ' + input_path + ' -json_export ' + json_path) run.command(applytopup_cmd + ' --imain=' + input_path + ' --datain=applytopup_config.txt --inindex=' + str(index) + ' --topup=field --out=' + temp_path + ' --method=jac') - file.delTempFile(input_path) + file.delTemporary(input_path) temp_path = fsl.findImage(temp_path) run.command('mrconvert ' + temp_path + ' ' + output_path + ' -json_import ' + json_path) - file.delTempFile(json_path) - file.delTempFile(temp_path) + file.delTemporary(json_path) + file.delTemporary(temp_path) applytopup_image_list.append(output_path) index += 1 @@ -476,7 +475,7 @@ if do_topup: run.command('mrcat ' + ' '.join(applytopup_image_list) + ' - | dwi2mask - - | maskfilter - dilate - | mrconvert - mask.nii -datatype float32 -stride -1,+2,+3') for entry in applytopup_image_list: - file.delTempFile(entry) + file.delTemporary(entry) eddy_in_topup_option = ' --topup=field' @@ -498,7 +497,7 @@ run.command(eddy_cmd + ' --imain=dwi.nii --mask=mask.nii --acqp=eddy_config.txt # Get the axis strides from the input series, so the output image can be modified to match -stride_option = ' -stride ' + stride.replace(' ', ',') +stride_option = ' -stride ' + dwi_header.stride.replace(' ', ',') diff --git a/bin/labelsgmfix b/bin/labelsgmfix index c62c907fa4..70383e0cd9 100755 --- a/bin/labelsgmfix +++ b/bin/labelsgmfix @@ -17,8 +17,7 @@ if not os.path.isdir(lib_folder): sys.path.insert(0, lib_folder) -from distutils.spawn import find_executable -from mrtrix3 import app, image, path, run +from mrtrix3 import app, fsl, image, path, run app.init('Robert E. Smith (robert.smith@florey.edu.au)', @@ -99,7 +98,7 @@ for key, value in structure_map.items(): mask_list.append(image_path) vtk_in_path = 'first-' + key + '_first.vtk' if not os.path.exists(vtk_in_path): - app.error('Missing .vtk file for structure ' + struct + '; run_first_all must have failed') + app.error('Missing .vtk file for structure ' + key + '; run_first_all must have failed') run.command('meshconvert ' + vtk_in_path + ' first-' + key + '_transformed.vtk -transform first2real T1.nii') run.command('mesh2pve first-' + key + '_transformed.vtk parc.mif - | mrthreshold - ' + image_path + ' -abs 0.5') # Add to the SGM image; don't worry about overlap for now From ccaf0cda5bdb7e9fc36b4817b607d102d2a467ec Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 15 Aug 2017 17:38:14 +1000 Subject: [PATCH 063/538] Testing: Use pylint New script run_pylint in root directory runs pylint on all Python files in bin/ and lib/. This is included in the Travis CI tests, and should be tested independently in Python versions 2 and 3. File testing/pylint.rc specifies what types of warnings / errors will be reported by pylint and hence result in testing failure. There are also a wide range of fixes that have been applied to the repository in order to pass the majority of tests; remaining issues are mostly to do with pylint usage (reporting library functions as unused variables), and accessing protected members from mrtrix3.app, which should be refactored. Discussion ongoing in #1074. --- .travis.yml | 10 +- bin/5ttgen | 5 +- bin/average_response | 7 +- bin/blend | 18 +- bin/convert_bruker | 36 +-- bin/dwi2response | 5 +- bin/dwibiascorrect | 7 +- bin/dwigradcheck | 5 +- bin/dwiintensitynorm | 21 +- bin/dwipreproc | 23 +- bin/labelsgmfix | 3 +- bin/population_template | 309 +++++++++--------- lib/mrtrix3/_5ttgen/freesurfer.py | 13 +- lib/mrtrix3/_5ttgen/fsl.py | 19 +- lib/mrtrix3/algorithm.py | 6 +- lib/mrtrix3/app.py | 114 ++++--- lib/mrtrix3/dwi2response/dhollander.py | 16 +- lib/mrtrix3/dwi2response/fa.py | 12 +- lib/mrtrix3/dwi2response/manual.py | 10 +- lib/mrtrix3/dwi2response/msmt_5tt.py | 13 +- lib/mrtrix3/dwi2response/tax.py | 10 +- lib/mrtrix3/dwi2response/tournier.py | 14 +- lib/mrtrix3/file.py | 10 +- lib/mrtrix3/fsl.py | 7 +- lib/mrtrix3/image.py | 47 ++- lib/mrtrix3/path.py | 17 +- lib/mrtrix3/phaseEncoding.py | 29 +- lib/mrtrix3/run.py | 25 +- run_pylint | 84 +++++ testing/pylint.rc | 422 +++++++++++++++++++++++++ 30 files changed, 922 insertions(+), 395 deletions(-) create mode 100755 run_pylint create mode 100644 testing/pylint.rc diff --git a/.travis.yml b/.travis.yml index ab4826a12f..10511ff80b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,8 @@ addons: - libqt4-opengl-dev - g++-4.8 - python3 + - python-pip + - python3-pip compiler: - clang env: @@ -16,15 +18,19 @@ env: - py=python3 install: - export NUMBER_OF_PROCESSORS=4 - - export PATH=`pwd`/release/bin:`pwd`/scripts:${PATH} + - export PATH=`pwd`/bin:${PATH} + - export PYTHONPATH=`pwd`/lib:${PYTHONPATH} - export EIGEN_CFLAGS=-I`pwd`/../eigen - (cd ..; hg clone https://bitbucket.org/eigen/eigen/; cd eigen; hg update 3.3) + - pip install pylint + - pip3 install pylint script: - - ./check_memalign && $py ./configure -assert && $py ./build -nowarnings && ./run_tests + - ./check_memalign && $py ./configure -assert && PYTHON=$py ./run_pylint && $py ./build -nowarnings && ./run_tests after_failure: - cat memalign.log - cat configure.log + - cat pylint.log - cat build.log - cat testing.log - sleep 10 diff --git a/bin/5ttgen b/bin/5ttgen index 2cf251d5f0..b79c31a34e 100755 --- a/bin/5ttgen +++ b/bin/5ttgen @@ -46,10 +46,9 @@ app.gotoTempDir() alg.execute() -(stdout,stderr) = run.command('5ttcheck result.mif', False) -if len(stderr) and 'ERROR' in stderr: +stderr = run.command('5ttcheck result.mif', False)[1] +if stderr and 'ERROR' in stderr: app.warn('Generated image does not perfectly conform to 5TT format') run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + (' -force' if app.force else '')) app.complete() - diff --git a/bin/average_response b/bin/average_response index bc1b12875c..a6dd04befe 100755 --- a/bin/average_response +++ b/bin/average_response @@ -1,8 +1,7 @@ #!/usr/bin/env python import sys -import string -def errorMessage (msg): +def errorMessage(msg): print (msg) exit(1) @@ -33,7 +32,7 @@ for i in range(1, num_subjects + 1): print ("Number of b-values: " + str(num_bvals)) -average_response = [[0 for x in range(num_coeff)] for y in range(num_bvals)] +average_response = [[0 for x in range(num_coeff)] for y in range(num_bvals)] for i in range(1, num_subjects + 1): with open(sys.argv[i], 'r') as f: lines = f.readlines() @@ -44,7 +43,7 @@ for i in range(1, num_subjects + 1): f = open(sys.argv[len(sys.argv)-1], 'w') line_out = '' -for l in range(num_bvals): +for l in range(num_bvals): line_out = '' for c in range(0, num_coeff): line_out = line_out + "{0:.5f}".format(average_response[l][c]) + ' ' diff --git a/bin/blend b/bin/blend index c0a9dab3c3..8677e9bd60 100755 --- a/bin/blend +++ b/bin/blend @@ -5,9 +5,9 @@ import string import math if len(sys.argv) <= 1: - print 'A script to blend two sets of movie frames together with a desired overlap.' - print 'The input arguments are two folders containing the movie frames (eg. output from the MRview screenshot tool), and the desired number of overlapping frames.' - print 'eg: blend folder1 folder2 20 output_folder' + print ('A script to blend two sets of movie frames together with a desired overlap.') + print ('The input arguments are two folders containing the movie frames (eg. output from the MRview screenshot tool), and the desired number of overlapping frames.') + print ('eg: blend folder1 folder2 20 output_folder') sys.exit(1) input_folder1 = sys.argv[1] @@ -19,18 +19,18 @@ output_folder = sys.argv[4] if not os.path.exists(output_folder): os.mkdir(output_folder) - + total_num_output_frames = len(file_list1) + len(file_list2) - num_overlap for i in range(total_num_output_frames): file_name = 'frame' + '%0*d' % (5, i) + '.png' if (i <= (len(file_list1) - num_overlap)): os.system('cp -L ' + input_folder1 + '/' + file_list1[i] + ' ' + output_folder + '/' + file_name) if (i > (len(file_list1) - num_overlap)) and (i < (len(file_list1))): - i2 = i - (len(file_list1) - num_overlap) - 1 + i2 = i - (len(file_list1) - num_overlap) - 1 blend_amount = 100 * float(i2 + 1) / float(num_overlap) os.system('convert ' + input_folder1 + '/' + file_list1[i] + ' ' + input_folder2 + '/' + file_list2[i2] + ' -alpha on -compose blend -define compose:args=' + str(blend_amount) + ' -gravity South -composite ' + output_folder + '/' + file_name) if (i >= (len(file_list1))): - i2 = i - (len(file_list1) - num_overlap) - 1 - os.system('cp -L ' + input_folder2 + '/' + file_list2[i2] + ' ' + output_folder + '/' + file_name) - - + i2 = i - (len(file_list1) - num_overlap) - 1 + os.system('cp -L ' + input_folder2 + '/' + file_list2[i2] + ' ' + output_folder + '/' + file_name) + + diff --git a/bin/convert_bruker b/bin/convert_bruker index 043890b420..1a63ac442b 100755 --- a/bin/convert_bruker +++ b/bin/convert_bruker @@ -16,17 +16,17 @@ if not sys.argv[2].endswith ('.mih'): sys.exit (1) with open (os.path.join (os.path.dirname (sys.argv[1]), 'reco')) as f: - lines = f.read().split ('##$'); + lines = f.read().split ('##$') with open (os.path.join (os.path.dirname (sys.argv[1]), '../../acqp')) as f: - lines += f.read().split ('##$'); + lines += f.read().split ('##$') with open (os.path.join (os.path.dirname (sys.argv[1]), '../../method')) as f: - lines += f.read().split ('##$'); + lines += f.read().split ('##$') for line in lines: - line = line.lower(); + line = line.lower() if line.startswith ('reco_size='): mat_size = line.splitlines()[1].split() print ('mat_size', mat_size) @@ -62,28 +62,28 @@ with open (sys.argv[2], 'w') as f: f.write (',' + str(mat_size[2])) else: try: - nslices + dummy = nslices f.write (',' + str(nslices)) except: pass - + try: - nacq + dummy = nacq f.write (',' + str(nacq)) except: pass - f.write ('\nvox: ' + str(res[0]) + ',' + str(res[1])); - if len(res) > 2: - f.write (',' + str(res[2])); + f.write ('\nvox: ' + str(res[0]) + ',' + str(res[1])) + if len(res) > 2: + f.write (',' + str(res[2])) else: try: - slicethick + dummy = slicethick f.write (',' + str(slicethick)) except: pass try: - nacq + dummy = nacq f.write (',') except: pass @@ -101,24 +101,22 @@ with open (sys.argv[2], 'w') as f: f.write ('\nlayout: +0,+1') try: - nslices + dummy = nslices f.write (',+2') except: pass try: - nacq + dummy = nacq f.write (',+3') except: pass - f.write ('\nfile: ' + sys.argv[1] + '\n') + f.write ('\nfile: ' + sys.argv[1] + '\n') try: - bvec - bval + dummy = bvec + dummy = bval for n in range (0, len (bval)): f.write ('dw_scheme: ' + bvec[3*n] + ',' + bvec[3*n+1] + ',' + str(-float(bvec[3*n+2])) + ',' + bval[n] + '\n') except: pass - - diff --git a/bin/dwi2response b/bin/dwi2response index a75c32ce7a..6be360593a 100755 --- a/bin/dwi2response +++ b/bin/dwi2response @@ -74,7 +74,7 @@ if app.args.grad: grad_import_option = ' -grad ' + path.fromUser(app.args.grad, True) elif app.args.fslgrad: grad_import_option = ' -fslgrad ' + path.fromUser(app.args.fslgrad[0], True) + ' ' + path.fromUser(app.args.fslgrad[1], True) -elif not 'dw_scheme' in image.header(path.fromUser(app.args.input, False)).keyval: +elif 'dw_scheme' not in image.header(path.fromUser(app.args.input, False)).keyval: app.error('Script requires diffusion gradient table: either in image header, or using -grad / -fslgrad option') app.makeTempDir() @@ -95,7 +95,7 @@ app.gotoTempDir() # Check that the brain mask is appropriate -if not image.header('mask.mif').size[:3] == image.header('dwi.mif').size[:3]: +if image.header('mask.mif').size[:3] != image.header('dwi.mif').size[:3]: app.error('Dimensions of provided mask image do not match DWI') if int(image.statistic('mask.mif', 'count', 'mask.mif')) == 0: app.error('Input mask does not contain any voxels') @@ -110,4 +110,3 @@ alg.execute() if app.args.voxels: run.command('mrconvert voxels.mif ' + path.fromUser(app.args.voxels, True) + (' -force' if app.force else '')) app.complete() - diff --git a/bin/dwibiascorrect b/bin/dwibiascorrect index 1fd30a0e03..7dfa6ce827 100755 --- a/bin/dwibiascorrect +++ b/bin/dwibiascorrect @@ -44,8 +44,6 @@ if app.args.fsl: fast_cmd = fsl.exeName('fast') - fsl_suffix = fsl.suffix() - elif app.args.ants: if not find_executable('N4BiasFieldCorrection'): @@ -75,14 +73,14 @@ app.gotoTempDir() dwi_header = image.header('in.mif') if len(dwi_header.size) != 4: app.error('Input image must be a 4D image') -if not 'dw_scheme' in dwi_header.keyval: +if 'dw_scheme' not in dwi_header.keyval: app.error('No valid DW gradient scheme provided or present in image header') if len(dwi_header.keyval['dw_scheme']) != dwi_header.size[3]: app.error('DW gradient scheme contains different number of entries (' + str(len(dwi_header.keyval['dw_scheme'])) + ' to number of volumes in DWIs (' + dwi_header.size[3] + ')') # Generate a brain mask if required, or check the mask if provided if app.args.mask: - if not image.header('mask.mif').size[:3] == dwi_header.size[:3]: + if image.header('mask.mif').size[:3] != dwi_header.size[:3]: app.error('Provided mask image does not match input DWI') else: run.command('dwi2mask in.mif mask.mif') @@ -117,4 +115,3 @@ run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + (' if app.args.bias: run.command('mrconvert ' + bias_path + ' ' + path.fromUser(app.args.bias, True) + (' -force' if app.force else '')) app.complete() - diff --git a/bin/dwigradcheck b/bin/dwigradcheck index 04c0362dd0..8d034a2256 100755 --- a/bin/dwigradcheck +++ b/bin/dwigradcheck @@ -10,7 +10,7 @@ if not os.path.isdir(lib_folder): sys.exit(1) sys.path.insert(0, lib_folder) -import copy, decimal, numbers, shutil +import copy, numbers, shutil from mrtrix3 import app, image, run, path app.init('Robert E. Smith (robert.smith@florey.edu.au)', 'Check the orientation of the diffusion gradient table') @@ -99,7 +99,7 @@ number_option = ' -select ' + str(app.args.number) # -# TODO What variations of gradient errors can we conceive? +# What variations of gradient errors can we conceive? # Done: # * Has an axis been flipped? (none, 0, 1, 2) @@ -205,4 +205,3 @@ if grad_export_option: app.complete() - diff --git a/bin/dwiintensitynorm b/bin/dwiintensitynorm index 0c0ab4db0e..9bd0bf7a4e 100755 --- a/bin/dwiintensitynorm +++ b/bin/dwiintensitynorm @@ -10,7 +10,6 @@ if not os.path.isdir(lib_folder): sys.path.insert(0, lib_folder) -import math from mrtrix3 import app, file, image, path, run @@ -45,14 +44,14 @@ app.parse() app.args.input_dir = relpath(app.args.input_dir) inputDir = app.args.input_dir if not os.path.exists(inputDir): - app.error('input directory not found'); + app.error('input directory not found') inFiles = os.listdir(inputDir) if len(inFiles) <= 1: app.console('not enough images found in input directory. More than one image is needed to perform a group-wise intensity normalisation') else: app.console('performing global intensity normalisation on ' + str(len(inFiles)) + ' input images') -app.args.mask_dir = relpath(app.args.mask_dir); +app.args.mask_dir = relpath(app.args.mask_dir) maskDir = app.args.mask_dir if not os.path.exists(maskDir): app.error('mask directory not found') @@ -65,14 +64,14 @@ for m in maskFiles: maskPrefixes.append(m.split(maskCommonPostfix)[0]) commonPostfix = path.commonPostfix(inFiles) -input = [] +input_list = [] for i in inFiles: - prefix = i.split(commonPostfix)[0] - if prefix not in maskPrefixes: + subj_prefix = i.split(commonPostfix)[0] + if subj_prefix not in maskPrefixes: app.error ('no matching mask image was found for input image ' + i) image.check3DNonunity(os.path.join(path.fromUser(inputDir, False), i)) - index = maskPrefixes.index(prefix) - input.append(Input(i, prefix, path.fromUser(inputDir, False), maskFiles[index], path.fromUser(maskDir, False))) + index = maskPrefixes.index(subj_prefix) + input_list.append(Input(i, subj_prefix, path.fromUser(inputDir, False), maskFiles[index], path.fromUser(maskDir, False))) app.checkOutputPath(app.args.fa_template) app.checkOutputPath(app.args.wm_mask) @@ -88,8 +87,7 @@ app.gotoTempDir() file.makeDir('fa') app.console('Computing FA images') -input_filenames = [] -for i in input: +for i in input_list: run.command('dwi2tensor ' + abspath(i.directory, i.filename) + ' -mask ' + abspath(i.mask_directory, i.mask_filename) + ' - | tensor2metric - -fa ' + os.path.join('fa', i.prefix + '.mif')) app.console('Generating FA population template') @@ -97,7 +95,7 @@ run.command('population_template fa -mask_dir ' + maskTempDir + ' fa_template.mi run.command('mrthreshold fa_template.mif -abs ' + app.args.fa_threshold + ' template_wm_mask.mif') file.makeDir('wm_mask_warped') -for i in input: +for i in input_list: run.command('mrtransform template_wm_mask.mif -interp nearest -warp_full ' + os.path.join('population_template', 'warps', i.prefix + '.mif') + ' ' + os.path.join('wm_mask_warped', i.prefix + '.mif') + ' -from 2 -template ' + os.path.join('fa', i.prefix + '.mif')) run.command('dwinormalise ' + abspath(i.directory, i.filename) + ' ' + os.path.join('wm_mask_warped', i.prefix + '.mif') + ' ' + path.fromUser(os.path.join(app.args.output_dir, i.filename), True) + (' -force' if app.force else '')) @@ -105,4 +103,3 @@ run.command('mrconvert template_wm_mask.mif ' + path.fromUser(app.args.wm_mask, run.command('mrconvert fa_template.mif ' + path.fromUser(app.args.fa_template, True) + (' -force' if app.force else '')) app.complete() - diff --git a/bin/dwipreproc b/bin/dwipreproc index dbe7236eb2..9a9374dfc4 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -139,7 +139,7 @@ if app.args.se_epi: if not len(se_epi_header.size) == 4: app.error('File provided using -se_epi option must contain more than one image volume') topup_pe_scheme = phaseEncoding.getScheme('se_epi.mif') -if not 'dw_scheme' in dwi_header.keyval: +if 'dw_scheme' not in dwi_header.keyval: app.error('No diffusion gradient table found') grad = dwi_header.keyval['dw_scheme'] if not len(grad) == num_volumes: @@ -151,7 +151,7 @@ if not len(grad) == num_volumes: # such information is present in the header, let's grab it here manual_pe_dir = None if app.args.pe_dir: - manual_pe_dir = [ float(i) for i in phaseEncoding.dir(app.args.pe_dir) ] + manual_pe_dir = [ float(i) for i in phaseEncoding.direction(app.args.pe_dir) ] manual_trt = None if app.args.readout_time: manual_trt = float(app.args.readout_time) @@ -236,8 +236,8 @@ if manual_pe_dir: for index2 in range(int(num_volumes/2), num_volumes): if grads_matched[index2] == num_volumes: # Also as yet unpaired if grads_match(grad[index1], grad[index2]): - grads_matched[index1] = index2; - grads_matched[index2] = index1; + grads_matched[index1] = index2 + grads_matched[index2] = index1 grad_pairs.append([index1, index2]) app.debug('Matched volume ' + str(index1) + ' with ' + str(index2) + ': ' + str(grad[index1]) + ' ' + str(grad[index2])) break @@ -326,8 +326,6 @@ if app.args.se_epi: # 3 possible sources of PE information: DWI header, topup image header, command-line # Any pair of these may conflict, and any one could be absent - topup_auto_trt_warning = False - # Have to switch here based on phase-encoding acquisition design if PE_design == 'Pair': # Criteria: @@ -371,7 +369,7 @@ if app.args.se_epi: # * If _not_ present in own header: # Cannot proceed if not topup_pe_scheme: - app.error('No phase-encoding information present in SE EPI image header'); + app.error('No phase-encoding information present in SE EPI image header') elif not PE_design == 'None': # No SE EPI images explicitly provided: In some cases, can extract appropriate b=0 images from DWI @@ -386,7 +384,7 @@ elif not PE_design == 'None': # No SE EPI images explicitly provided: In some ca # If there's no contrast remaining in the phase-encoding scheme, it'll be written to # PhaseEncodingDirection and TotalReadoutTime rather than pe_scheme # In this scenario, we will be unable to run topup, or volume recombination - if not 'pe_scheme' in se_epi_header.keyval: + if 'pe_scheme' not in se_epi_header.keyval: if PE_design == 'All': app.error('DWI header indicates no phase encoding contrast between b=0 images; cannot proceed with volume recombination-based pre-processing') else: @@ -417,7 +415,6 @@ if do_topup: # Otherwise, need to call mrcrop with the appropriate options, and pass those to topup topup_in_path = 'se_epi.mif' # For any non-even axis sizes, crop the first voxel along that dimension - # TODO This primarily applies to topup - don't recall if eddy bugs out or not crop_option = '' for axis, axis_size in enumerate(se_epi_header.size[:3]): if int(axis_size)%2: @@ -497,7 +494,7 @@ run.command(eddy_cmd + ' --imain=dwi.nii --mask=mask.nii --acqp=eddy_config.txt # Get the axis strides from the input series, so the output image can be modified to match -stride_option = ' -stride ' + dwi_header.stride.replace(' ', ',') +stride_option = ' -stride ' + ','.join([str(i) for i in dwi_header.stride]) @@ -523,8 +520,8 @@ for index1 in range(num_volumes): if volume_matchings[index2] == num_volumes: # Also as yet unpaired # Here, need to check both gradient matching and reversed phase-encode direction if not any(dwi_pe_scheme[index1][i] + dwi_pe_scheme[index2][i] for i in range(0,3)) and grads_match(grad[index1], grad[index2]): - volume_matchings[index1] = index2; - volume_matchings[index2] = index1; + volume_matchings[index1] = index2 + volume_matchings[index2] = index1 volume_pairs.append([index1, index2]) app.debug('Matched volume ' + str(index1) + ' with ' + str(index2) + '\n' + 'Phase encoding: ' + str(dwi_pe_scheme[index1]) + ' ' + str(dwi_pe_scheme[index2]) + '\n' + @@ -547,7 +544,6 @@ else: # potentially have subject rotation between them (and therefore the sensitisation direction is # not precisely equivalent), the best we can do is take the mean of the two vectors. # Manual recombination of volumes needs to take into account the explicit volume matching - # TODO Re-test eddy LSR bvecs = [ [] for axis in range(3) ] with open(bvecs_path, 'r') as f: @@ -669,4 +665,3 @@ else: # Finish! run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + grad_export_option + (' -force' if app.force else '')) app.complete() - diff --git a/bin/labelsgmfix b/bin/labelsgmfix index 70383e0cd9..01ba69f93a 100755 --- a/bin/labelsgmfix +++ b/bin/labelsgmfix @@ -119,7 +119,7 @@ run.command('labelconvert sgm_masked.mif ' + sgm_lut_file_path + ' ' + path.from # * Figure out what index the structure has been mapped to; this can only be done using mrstats # * Strip that index from the parcellation image # * Insert the new delineation of that structure -for struct in structure_map.keys(): +for struct in structure_map: image_path = struct + '_mask.mif' index = image.statistic('sgm_new_labels.mif', 'median', image_path) run.command('mrcalc parc.mif ' + index + ' -eq 0 parc.mif -if parc_removed.mif') @@ -132,4 +132,3 @@ for struct in structure_map.keys(): run.command('mrcalc sgm_new_labels.mif 0.5 -gt sgm_new_labels.mif parc.mif -if result.mif -datatype uint32') run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + (' -force' if app.force else '')) app.complete() - diff --git a/bin/population_template b/bin/population_template index b8b90a077f..f3c66ec2a5 100755 --- a/bin/population_template +++ b/bin/population_template @@ -18,8 +18,16 @@ copytree = shutil.copytree rmtree = shutil.rmtree remove = os.remove +# Binds raw_input() to input() in Python2, so that input() can be used +# and the code will work on both Python 2 and 3 +try: + #pylint: disable=redefined-builtin + input = raw_input +except NameError: + pass + -import math, shutil +import math from mrtrix3 import app, file, image, path, run @@ -30,48 +38,46 @@ def abspath(*arg): def relpath(*arg): return os.path.relpath(os.path.join(*arg), app._workingDir) -def allindir(dir): - return ' '.join( [ os.path.join(dir, file) for file in os.listdir(dir) ] ) +def allindir(directory): + return ' '.join( [ os.path.join(directory, file) for file in os.listdir(directory) ] ) try: from numpy import loadtxt, savetxt, dot except ImportError: - app.console("numpy not found. using replacement functions") + app.console("numpy not found; using replacement functions") def loadtxt(fname, delimiter=" ", dtype=float): with open(fname, "r") as f: return [[dtype(x) for x in l.rstrip().split(delimiter)] for l in f.readlines()] def savetxt(fname, X, delimiter=" ", fmt="%.14e"): - import sys try: if sys.version_info[0] >= 3: fh = open(fname, 'wb') else: fh = open(fname, 'w') if len(X) == 1: - ncol = 1 + ncol = 1 else: ncol = len(X[0]) fmt = [fmt, ] * ncol - format = delimiter.join(fmt) + row_format = delimiter.join(fmt) for row in X: - fh.write((format % tuple(row) + '\n')) + fh.write((row_format % tuple(row) + '\n')) finally: - fh.close() + fh.close() def dot(a, b): # matrix dot product # does not check input dimensions return [[sum(x*y for x,y in zip(a_row,b_col)) for b_col in zip(*b)] for a_row in a] -def check_linear_transformation (transformation, command, max_scaling = 0.5, max_shear = 0.2, max_rot = 2 * math.pi, pause_on_warn = True): - import os +def check_linear_transformation (transformation, cmd, max_scaling = 0.5, max_shear = 0.2, max_rot = 2 * math.pi, pause_on_warn = True): - def load_key_value(file): + def load_key_value(file_path): res = {} - with open (file, "r") as f: + with open (file_path, "r") as f: for line in f.readlines(): if len(line)==1 or line.startswith("#"): continue @@ -103,11 +109,11 @@ def check_linear_transformation (transformation, command, max_scaling = 0.5, max bGood = False if not bGood: - newcommand = [] + newcmd = [] what = '' init_rotation_found = False skip = 0 - for e in command.split(): + for e in cmd.split(): if skip: skip -= 1 continue @@ -117,27 +123,27 @@ def check_linear_transformation (transformation, command, max_scaling = 0.5, max skip = 1 continue if 'affine_scale' in e: - assert (what != 'rigid') + assert what != 'rigid' what = 'affine' elif 'rigid_scale' in e: - assert (what != 'affine') + assert what != 'affine' what = 'rigid' - newcommand.append(e) - newcommand=" ".join(newcommand) + newcmd.append(e) + newcmd=" ".join(newcmd) if not init_rotation_found: app.console("replacing the transformation obtained with:") - app.console(command) + app.console(cmd) if what: - newcommand += ' -'+what+'_init_translation mass -'+what+'_init_rotation search' + newcmd += ' -'+what+'_init_translation mass -'+what+'_init_rotation search' app.console("by the one obtained with:") - app.console(newcommand) - run.command(newcommand) - return check_linear_transformation (transformation, newcommand, max_scaling, max_shear, max_rot, pause_on_warn = pause_on_warn) + app.console(newcmd) + run.command(newcmd) + return check_linear_transformation (transformation, newcmd, max_scaling, max_shear, max_rot, pause_on_warn = pause_on_warn) elif pause_on_warn: app.warn("you might want to manually repeat mrregister with different parameters and overwrite the transformation file: \n%s" % transformation) - app.console('The command that failed the test was: \n' + command) + app.console('The command that failed the test was: \n' + cmd) app.console('Working directory: \n' + os.getcwd()) - raw_input("press enter to continue population_template") + input("press enter to continue population_template") return bGood class Input: @@ -208,7 +214,7 @@ assert (dorigid + doaffine + dononlinear >= 1), "FIXME: registration type not va app.args.input_dir = relpath(app.args.input_dir) inputDir = app.args.input_dir if not os.path.exists(inputDir): - app.error('input directory not found'); + app.error('input directory not found') inFiles = sorted(os.listdir(inputDir)) if len(inFiles) <= 1: app.console('Not enough images found in input directory. More than one image is needed to generate a population template') @@ -221,27 +227,27 @@ if app.args.voxel_size: if len(voxel_size) == 1: voxel_size = voxel_size * 3 try: - if len(voxel_size) != 3: - raise + assert len(voxel_size) == 3 + #pylint: disable=expression-not-assigned [float(v) for v in voxel_size] except: - app.error('voxel size needs to be a single or three comma separated floating point numbers, received: '+str(app.args.voxel_size)) + app.error('voxel size needs to be a single or three comma-separated floating point numbers; received: ' + str(app.args.voxel_size)) initial_alignment = app.args.initial_alignment if initial_alignment not in ["mass", "geometric", "none"]: - message.error('initial_alignment must be one of ' + " ".join(["mass", "geometric", "none"])); + app.error('initial_alignment must be one of ' + " ".join(["mass", "geometric", "none"])) linear_estimator = app.args.linear_estimator if linear_estimator: if not dononlinear: - app.error('linear_estimator specified when no linear registration is requested'); + app.error('linear_estimator specified when no linear registration is requested') if linear_estimator not in ["l1", "l2", "lp"]: - app.error('linear_estimator must be one of ' + " ".join(["l1", "l2", "lp"])); + app.error('linear_estimator must be one of ' + " ".join(["l1", "l2", "lp"])) useMasks = False if app.args.mask_dir: useMasks = True - app.args.mask_dir = relpath(app.args.mask_dir); + app.args.mask_dir = relpath(app.args.mask_dir) maskDir = app.args.mask_dir if not os.path.exists(maskDir): app.error('mask directory not found') @@ -260,17 +266,17 @@ if app.args.template_mask and not useMasks: app.error('you cannot output a template mask because no subject masks were input using -mask_dir') commonPostfix = path.commonPostfix(inFiles) -input = [] +inputs = [] for i in inFiles: image.check3DNonunity(os.path.join(path.fromUser(inputDir, False), i)) - prefix = i.split(commonPostfix)[0] + subj_prefix = i.split(commonPostfix)[0] if useMasks: - if prefix not in maskPrefixes: + if subj_prefix not in maskPrefixes: app.error ('no matching mask image was found for input image ' + i) - index = maskPrefixes.index(prefix) - input.append(Input(i, prefix, path.fromUser(inputDir, False), maskFiles[index], path.fromUser(maskDir, False))) + index = maskPrefixes.index(subj_prefix) + inputs.append(Input(i, subj_prefix, path.fromUser(inputDir, False), maskFiles[index], path.fromUser(maskDir, False))) else: - input.append(Input(i, prefix, path.fromUser(inputDir, False))) + inputs.append(Input(i, subj_prefix, path.fromUser(inputDir, False))) noreorientation = app.args.noreorientation @@ -301,11 +307,11 @@ if app.args.linear_transformations_dir: # automatically detect SH series do_fod_registration = False -image_size = image.header(relpath(input[0].directory, input[0].filename)).size +image_size = image.header(relpath(inputs[0].directory, inputs[0].filename)).size if len(image_size) < 3 or len(image_size) > 4: app.error('only 3 and 4 dimensional images can be used to build a template') if len(image_size) == 4: - val = (math.sqrt (1 + 8 * image_size[3]) - 3.0) / 4.0; + val = (math.sqrt (1 + 8 * image_size[3]) - 3.0) / 4.0 if not (val - int(val)) and not noreorientation: app.console("SH series detected, performing FOD registration") do_fod_registration = True @@ -370,10 +376,10 @@ if doaffine: linear_niter += affine_niter linear_type += ['affine'] * len(affine_scales) -assert (len(linear_type) == len(linear_scales)) -assert (len(linear_scales) == len(linear_niter)) +assert len(linear_type) == len(linear_scales) +assert len(linear_scales) == len(linear_niter) if do_fod_registration: - assert (len(linear_lmax) == len(linear_niter)) + assert len(linear_lmax) == len(linear_niter) app.console('initial alignment of images: %s' % initial_alignment) @@ -420,7 +426,7 @@ else: app.makeTempDir() app.gotoTempDir() -file.makeDir('input_transformed') +file.makeDir('inputs_transformed') file.makeDir('linear_transforms_initial') file.makeDir('linear_transforms') for level in range(0, len(linear_scales)): @@ -437,8 +443,8 @@ if write_log: # Make initial template in average space app.console('Generating initial template') input_filenames = [] -for i in input: - input_filenames.append (abspath(i.directory, i.filename)); +for i in inputs: + input_filenames.append(abspath(i.directory, i.filename)) if voxel_size is None: run.command('mraverageheader ' + ' '.join(input_filenames) + ' average_header.mif -fill') else: @@ -447,9 +453,9 @@ else: # crop average space to extent defined by original masks if useMasks: mask_filenames = [] - for i in input: - run.command('mrtransform ' + abspath(i.mask_directory, i.mask_filename) + - ' -interp nearest -template average_header.mif ' + os.path.join('masks_transformed', i.mask_filename)) + for i in inputs: + run.command('mrtransform ' + abspath(i.mask_directory, i.mask_filename) + \ + ' -interp nearest -template average_header.mif ' + os.path.join('masks_transformed', i.mask_filename)) mask_filenames.append(os.path.join('masks_transformed', i.mask_filename)) run.command('mrmath ' + ' '.join(mask_filenames) + ' max mask_initial.mif' ) run.command('mrcrop ' + 'average_header.mif -mask mask_initial.mif average_header_cropped.mif') @@ -461,39 +467,39 @@ if useMasks: if initial_alignment == 'none': - for i in input: - run.command('mrtransform ' + abspath(i.directory, i.filename) + ' -interp linear -template average_header.mif ' + os.path.join('input_transformed', i.prefix + '.mif') + datatype) + for i in inputs: + run.command('mrtransform ' + abspath(i.directory, i.filename) + ' -interp linear -template average_header.mif ' + os.path.join('inputs_transformed', i.prefix + '.mif') + datatype) if not dolinear: - for i in input: + for i in inputs: with open(os.path.join('linear_transforms_initial','%s.txt' % (i.prefix)),'w') as fout: fout.write('1 0 0 0\n0 1 0 0\n0 0 1 0\n0 0 0 1\n') else: mask = '' - for i in input: + for i in inputs: if useMasks: mask = ' -mask1 ' + abspath(i.mask_directory, i.mask_filename) output = ' -rigid ' + os.path.join('linear_transforms_initial', i.prefix + '.txt') - run.command('mrregister ' + abspath(i.directory, i.filename) + ' average_header.mif' + - mask + - ' -rigid_scale 1 ' + - ' -rigid_niter 0 ' + - ' -type rigid ' + - ' -noreorientation ' + - ' -rigid_init_translation ' + initial_alignment + ' ' + - datatype + + run.command('mrregister ' + abspath(i.directory, i.filename) + ' average_header.mif' + \ + mask + \ + ' -rigid_scale 1 ' + \ + ' -rigid_niter 0 ' + \ + ' -type rigid ' + \ + ' -noreorientation ' + \ + ' -rigid_init_translation ' + initial_alignment + ' ' + \ + datatype + \ output) # translate input images to centre of mass without interpolation - run.command('mrtransform ' + abspath(i.directory, i.filename) + - ' -linear ' + os.path.join('linear_transforms_initial', i.prefix + '.txt') + - datatype + - ' ' + os.path.join('input_transformed', i.prefix + '_translated.mif')) + run.command('mrtransform ' + abspath(i.directory, i.filename) + \ + ' -linear ' + os.path.join('linear_transforms_initial', i.prefix + '.txt') + \ + datatype + \ + ' ' + os.path.join('inputs_transformed', i.prefix + '_translated.mif')) if useMasks: - run.command('mrtransform ' + abspath(i.mask_directory, i.mask_filename) + - ' -linear ' + os.path.join('linear_transforms_initial', i.prefix + '.txt') + - datatype + - ' ' + os.path.join('masks_transformed', i.prefix + '_translated.mif')) + run.command('mrtransform ' + abspath(i.mask_directory, i.mask_filename) + \ + ' -linear ' + os.path.join('linear_transforms_initial', i.prefix + '.txt') + \ + datatype + ' ' + \ + os.path.join('masks_transformed', i.prefix + '_translated.mif')) # update average space to new extent - run.command('mraverageheader ' + ' '.join([os.path.join('input_transformed', i.prefix + '_translated.mif') for i in input]) + ' average_header_tight.mif') + run.command('mraverageheader ' + ' '.join([os.path.join('inputs_transformed', i.prefix + '_translated.mif') for i in inputs]) + ' average_header_tight.mif') if voxel_size is None: run.command('mrpad -uniform 10 average_header_tight.mif average_header.mif -force') else: @@ -501,52 +507,52 @@ else: run.function(remove, 'average_header_tight.mif') if useMasks: # reslice masks - for i in input: - run.command('mrtransform ' + - ' ' + os.path.join('masks_transformed', i.prefix + '_translated.mif') + - ' ' + os.path.join('masks_transformed', i.prefix + '.mif') + - ' -interp nearest -template average_header.mif' + - datatype) + for i in inputs: + run.command('mrtransform ' + \ + os.path.join('masks_transformed', i.prefix + '_translated.mif') + ' ' + \ + os.path.join('masks_transformed', i.prefix + '.mif') + ' ' + \ + '-interp nearest -template average_header.mif' + \ + datatype) # crop average space to extent defined by translated masks mask_filenames = [] - for i in input: + for i in inputs: mask_filenames.append(os.path.join('masks_transformed', i.prefix + '.mif')) run.command('mrmath ' + ' '.join(mask_filenames) + ' max mask_translated.mif' ) run.command('mrcrop ' + 'average_header.mif -mask mask_translated.mif average_header_cropped.mif') # pad average space to allow for deviation from initial alignment run.command('mrpad -uniform 10 average_header_cropped.mif -force average_header.mif') run.function(remove, 'average_header_cropped.mif') - for i in input: + for i in inputs: run.command('mrtransform ' + - ' ' + os.path.join('masks_transformed', i.prefix + '_translated.mif') + - ' ' + os.path.join('masks_transformed', i.prefix + '.mif') + - ' -interp nearest -template average_header.mif' + - datatype + - ' -force') + os.path.join('masks_transformed', i.prefix + '_translated.mif') + ' ' + \ + os.path.join('masks_transformed', i.prefix + '.mif') + ' ' + \ + '-interp nearest -template average_header.mif' + \ + datatype + ' ' + \ + '-force') run.function(remove, os.path.join('masks_transformed', i.prefix + '_translated.mif')) run.function(remove, 'mask_translated.mif') # reslice input images - for i in input: - run.command('mrtransform ' + - ' ' + os.path.join('input_transformed', i.prefix + '_translated.mif') + - ' ' + os.path.join('input_transformed', i.prefix + '.mif') + - ' -interp linear -template average_header.mif' + - datatype) - run.function(remove, os.path.join('input_transformed', i.prefix + '_translated.mif')) + for i in inputs: + run.command('mrtransform ' + \ + os.path.join('inputs_transformed', i.prefix + '_translated.mif') + ' ' + \ + os.path.join('inputs_transformed', i.prefix + '.mif') + ' ' + \ + '-interp linear -template average_header.mif' + \ + datatype) + run.function(remove, os.path.join('inputs_transformed', i.prefix + '_translated.mif')) -run.command('mrmath ' + allindir('input_transformed') + ' mean initial_template.mif') +run.command('mrmath ' + allindir('inputs_transformed') + ' mean initial_template.mif') current_template = 'initial_template.mif' # Optimise template with linear registration if not dolinear: - for i in input: + for i in inputs: run.function(copy, os.path.join('linear_transforms_initial','%s.txt' % (i.prefix)), 'linear_transforms') else: app.console('Optimising template with linear registration') for level in range(0, len(linear_scales)): - for i in input: + for i in inputs: initialise = '' if useMasks: mask = ' -mask1 ' + abspath(i.mask_directory, i.mask_filename) @@ -587,17 +593,17 @@ else: mrregister_log = ' -info -affine_log ' + os.path.join('log', i.filename + '_' + str(level) + '.log') command = 'mrregister ' + abspath(i.directory, i.filename) + ' ' + current_template + \ - ' -force' + \ - initialise + \ - mask + \ - scale + \ - niter + \ - lmax + \ - regtype + \ - metric + \ - datatype + \ - output + \ - mrregister_log + ' -force' + \ + initialise + \ + mask + \ + scale + \ + niter + \ + lmax + \ + regtype + \ + metric + \ + datatype + \ + output + \ + mrregister_log run.command(command) check_linear_transformation(os.path.join('linear_transforms_%i' % level, '%s.txt' % i.prefix), command, pause_on_warn=do_pause_on_warn) @@ -609,34 +615,34 @@ else: average_inv = run.function(loadtxt, 'linear_transform_average_inv.txt') if average_inv is not None: - for i in input: + for i in inputs: transform = dot(loadtxt(os.path.join('linear_transforms_%i' % level, '%s.txt' % i.prefix)), average_inv) savetxt(os.path.join('linear_transforms_%i' % level, '%s.txt' % i.prefix), transform) - for i in input: - run.command('mrtransform ' + abspath(i.directory, i.filename) + - ' -template ' + current_template + - ' -linear ' + os.path.join('linear_transforms_%i' % level, '%s.txt' % i.prefix) + - ' ' + os.path.join('input_transformed', '%s.mif' % i.prefix) + - datatype + - ' -force') + for i in inputs: + run.command('mrtransform ' + abspath(i.directory, i.filename) + ' ' + \ + '-template ' + current_template + ' ' + \ + '-linear ' + os.path.join('linear_transforms_%i' % level, '%s.txt' % i.prefix) + ' ' + \ + os.path.join('inputs_transformed', '%s.mif' % i.prefix) + \ + datatype + ' ' + \ + '-force') - run.command('mrmath ' + allindir('input_transformed') + ' mean linear_template' + str(level) + '.mif -force') + run.command('mrmath ' + allindir('inputs_transformed') + ' mean linear_template' + str(level) + '.mif -force') current_template = 'linear_template' + str(level) + '.mif' - for filename in os.listdir('linear_transforms_%i' % level): - run.function(copy, os.path.join('linear_transforms_%i' % level, filename), 'linear_transforms') + for entry in os.listdir('linear_transforms_%i' % level): + run.function(copy, os.path.join('linear_transforms_%i' % level, entry), 'linear_transforms') # Create a template mask for nl registration by taking the intersection of all transformed input masks and dilating if useMasks and (dononlinear or app.args.template_mask): - for i in input: - run.command('mrtransform ' + abspath(i.mask_directory, i.mask_filename) + - ' -template ' + current_template + - ' -interp nearest' + - ' -linear ' + os.path.join('linear_transforms', '%s.txt' % i.prefix) + - ' ' + os.path.join('masks_transformed', '%s.mif' % i.prefix) + - ' -force') + for i in inputs: + run.command('mrtransform ' + abspath(i.mask_directory, i.mask_filename) + ' ' + \ + '-template ' + current_template + ' ' + \ + '-interp nearest ' + \ + '-linear ' + os.path.join('linear_transforms', '%s.txt' % i.prefix) + ' ' + \ + os.path.join('masks_transformed', '%s.mif' % i.prefix) + ' ' + \ + '-force') run.command ('mrmath ' + allindir('masks_transformed') + ' min - | maskfilter - median - | maskfilter - dilate -npass 5 init_nl_template_mask.mif -force') current_template_mask = 'init_nl_template_mask.mif' @@ -645,7 +651,7 @@ if dononlinear: app.console('Optimising template with non-linear registration') file.makeDir('warps') for level in range(0, len(nl_scales)): - for i in input: + for i in inputs: if level > 0: initialise = ' -nl_init ' + os.path.join('warps_%i' % (level-1), '%s.mif' % i.prefix) scale = '' @@ -666,31 +672,31 @@ if dononlinear: else: lmax = ' -noreorientation' - run.command('mrregister ' + abspath(i.directory, i.filename) + ' ' + current_template + - ' -type nonlinear' + - ' -nl_niter ' + str(nl_niter[level]) + - ' -nl_warp_full ' + os.path.join('warps_%i' % level, '%s.mif' % i.prefix) + - ' -transformed ' + os.path.join('input_transformed', '%s.mif' % i.prefix) + - ' -nl_update_smooth ' + app.args.nl_update_smooth + - ' -nl_disp_smooth ' + app.args.nl_disp_smooth + - ' -nl_grad_step ' + app.args.nl_grad_step + - ' -force ' + - initialise + - scale + - mask + - datatype + - lmax) + run.command('mrregister ' + abspath(i.directory, i.filename) + ' ' + current_template + ' ' + \ + '-type nonlinear ' + \ + '-nl_niter ' + str(nl_niter[level]) + ' ' + \ + '-nl_warp_full ' + os.path.join('warps_%i' % level, '%s.mif' % i.prefix) + ' ' + \ + '-transformed ' + os.path.join('inputs_transformed', '%s.mif' % i.prefix) + ' ' + \ + '-nl_update_smooth ' + app.args.nl_update_smooth + ' ' + \ + '-nl_disp_smooth ' + app.args.nl_disp_smooth + ' ' + \ + '-nl_grad_step ' + app.args.nl_grad_step + ' ' + \ + '-force' + \ + initialise + \ + scale + \ + mask + \ + datatype + \ + lmax) if level > 0: run.function(remove, os.path.join('warps_%i'%(level-1), '%s.mif' % i.prefix)) if useMasks: - run.command('mrtransform ' + abspath(i.mask_directory, i.mask_filename) + - ' -template ' + current_template + - ' -warp_full ' + os.path.join('warps_%i' % level, '%s.mif' % i.prefix) + - ' ' + os.path.join('masks_transformed', i.prefix + '.mif') + - ' -interp nearest ' + - ' -force') - - run.command ('mrmath ' + allindir('input_transformed') + ' mean nl_template' + str(level) + '.mif') + run.command('mrtransform ' + abspath(i.mask_directory, i.mask_filename) + ' ' + \ + '-template ' + current_template + ' ' + \ + '-warp_full ' + os.path.join('warps_%i' % level, '%s.mif' % i.prefix) + ' ' + \ + os.path.join('masks_transformed', i.prefix + '.mif') + ' ' + \ + '-interp nearest ' + + '-force') + + run.command('mrmath ' + allindir('inputs_transformed') + ' mean nl_template' + str(level) + '.mif') current_template = 'nl_template' + str(level) + '.mif' if useMasks: @@ -698,13 +704,13 @@ if dononlinear: current_template_mask = 'nl_template_mask' + str(level) + '.mif' if level < len(nl_scales) - 1: - if (nl_scales[level] < nl_scales[level + 1]): + if nl_scales[level] < nl_scales[level + 1]: upsample_factor = nl_scales[level + 1] / nl_scales[level] - for i in input: + for i in inputs: run.command('mrresize ' + os.path.join('warps_%i' % level, '%s.mif' % i.prefix) + ' -scale %f tmp.mif' % upsample_factor) run.function(move, 'tmp.mif', os.path.join('warps_' + str(level), '%s.mif' % i.prefix)) else: - for i in input: + for i in inputs: run.function(move, os.path.join('warps_' + str(level), '%s.mif' % i.prefix), 'warps') @@ -726,10 +732,9 @@ if app.args.transformed_dir: transformed_path = path.fromUser(app.args.transformed_dir, False) if os.path.exists(transformed_path): run.function(rmtree, transformed_path) - run.function(copytree, 'input_transformed', transformed_path) + run.function(copytree, 'inputs_transformed', transformed_path) if app.args.template_mask: run.command('mrconvert ' + current_template_mask + ' ' + path.fromUser(app.args.template_mask, True) + (' -force' if app.force else '')) app.complete() - diff --git a/lib/mrtrix3/_5ttgen/freesurfer.py b/lib/mrtrix3/_5ttgen/freesurfer.py index b5d209b5c8..ea83a8aff8 100644 --- a/lib/mrtrix3/_5ttgen/freesurfer.py +++ b/lib/mrtrix3/_5ttgen/freesurfer.py @@ -1,6 +1,5 @@ +#pylint: disable=unused-variable def initialise(base_parser, subparsers): - import argparse - from mrtrix3 import app parser = subparsers.add_parser('freesurfer', author='Robert E. Smith (robert.smith@florey.edu.au)', synopsis='Generate the 5TT image based on a FreeSurfer parcellation image', parents=[base_parser]) parser.add_argument('input', help='The input FreeSurfer parcellation image (any image containing \'aseg\' in its name)') parser.add_argument('output', help='The output 5TT image') @@ -9,13 +8,15 @@ def initialise(base_parser, subparsers): +#pylint: disable=unused-variable def checkOutputPaths(): pass +#pylint: disable=unused-variable def getInputs(): - import os, shutil + import shutil from mrtrix3 import app, path, run run.command('mrconvert ' + path.fromUser(app.args.input, True) + ' ' + path.toTemp('input.mif', True)) if app.args.lut: @@ -23,6 +24,7 @@ def getInputs(): +#pylint: disable=unused-variable def execute(): import os, sys from mrtrix3 import app, path, run @@ -34,13 +36,13 @@ def execute(): app.error('Environment variable FREESURFER_HOME is not set; please run appropriate FreeSurfer configuration script, set this variable manually, or provide script with path to file FreeSurferColorLUT.txt using -lut option') lut_input_path = os.path.join(freesurfer_home, 'FreeSurferColorLUT.txt') if not os.path.isfile(lut_input_path): - app.error('Could not find FreeSurfer lookup table file (expected location: ' + freesurfer_lut + '), and none provided using -lut') + app.error('Could not find FreeSurfer lookup table file (expected location: ' + lut_input_path + '), and none provided using -lut') if app.args.sgm_amyg_hipp: lut_output_file_name = 'FreeSurfer2ACT_sgm_amyg_hipp.txt' else: lut_output_file_name = 'FreeSurfer2ACT.txt' - lut_output_path = os.path.join(path.sharedDataPath(), path.scriptSubDirName(), lut_output_file_name); + lut_output_path = os.path.join(path.sharedDataPath(), path.scriptSubDirName(), lut_output_file_name) if not os.path.isfile(lut_output_path): app.error('Could not find lookup table file for converting FreeSurfer parcellation output to tissues (expected location: ' + lut_output_path + ')') @@ -62,4 +64,3 @@ def execute(): run.command('mrcalc ' + image + ' 5 -eq path.mif') run.command('mrcat cgm.mif sgm.mif wm.mif csf.mif path.mif - -axis 3 | mrconvert - result.mif -datatype float32') - diff --git a/lib/mrtrix3/_5ttgen/fsl.py b/lib/mrtrix3/_5ttgen/fsl.py index 463ee470a7..5aaf122b91 100644 --- a/lib/mrtrix3/_5ttgen/fsl.py +++ b/lib/mrtrix3/_5ttgen/fsl.py @@ -1,6 +1,5 @@ +#pylint: disable=unused-variable def initialise(base_parser, subparsers): - import argparse - from mrtrix3 import app parser = subparsers.add_parser('fsl', author='Robert E. Smith (robert.smith@florey.edu.au)', synopsis='Use FSL commands to generate the 5TT image based on a T1-weighted image', parents=[base_parser]) parser.addCitation('', 'Smith, S. M. Fast robust automated brain extraction. Human Brain Mapping, 2002, 17, 143-155', True) parser.addCitation('', 'Zhang, Y.; Brady, M. & Smith, S. Segmentation of brain MR images through a hidden Markov random field model and the expectation-maximization algorithm. IEEE Transactions on Medical Imaging, 2001, 20, 45-57', True) @@ -16,13 +15,14 @@ def initialise(base_parser, subparsers): +#pylint: disable=unused-variable def checkOutputPaths(): pass +#pylint: disable=unused-variable def getInputs(): - import os from mrtrix3 import app, image, path, run image.check3DNonunity(path.fromUser(app.args.input, False)) run.command('mrconvert ' + path.fromUser(app.args.input, True) + ' ' + path.toTemp('input.mif', True)) @@ -36,9 +36,9 @@ def getInputs(): +#pylint: disable=unused-variable def execute(): import os - from distutils.spawn import find_executable from mrtrix3 import app, file, fsl, image, path, run if app.isWindows(): @@ -99,13 +99,13 @@ def execute(): # Also reduce the FoV of the image # Using MNI 1mm dilated brain mask rather than the -b option in standard_space_roi (which uses the 2mm mask); the latter looks 'buggy' to me... Unfortunately even with the 1mm 'dilated' mask, it can still cut into some brain areas, hence the explicit dilation mni_mask_path = os.path.join(fsl_path, 'data', 'standard', 'MNI152_T1_1mm_brain_mask_dil.nii.gz') - mni_mask_dilation = 0; + mni_mask_dilation = 0 if os.path.exists (mni_mask_path): - mni_mask_dilation = 4; + mni_mask_dilation = 4 else: mni_mask_path = os.path.join(fsl_path, 'data', 'standard', 'MNI152_T1_2mm_brain_mask_dil.nii.gz') if os.path.exists (mni_mask_path): - mni_mask_dilation = 2; + mni_mask_dilation = 2 if mni_mask_dilation: run.command('maskfilter ' + mni_mask_path + ' dilate mni_mask.nii -npass ' + str(mni_mask_dilation)) if app.args.nocrop: @@ -156,8 +156,8 @@ def execute(): else: combined_image_path = fsl.findImage('first_all_none_firstseg') if not os.path.isfile(combined_image_path): - app.error('FSL FIRST has failed; not all structures were segmented successfully (check ' + -path.toTemp('first.logs', False) + ')') + app.error('FSL FIRST has failed; not all structures were segmented successfully (check ' + \ + path.toTemp('first.logs', False) + ')') # Convert FIRST meshes to partial volume images pve_image_list = [ ] @@ -196,4 +196,3 @@ def execute(): run.command('mrconvert combined_precrop.mif result.mif') else: run.command('mrmath combined_precrop.mif sum - -axis 3 | mrthreshold - - -abs 0.5 | mrcrop combined_precrop.mif result.mif -mask -') - diff --git a/lib/mrtrix3/algorithm.py b/lib/mrtrix3/algorithm.py index 114476d9c8..7c07f3577b 100644 --- a/lib/mrtrix3/algorithm.py +++ b/lib/mrtrix3/algorithm.py @@ -15,9 +15,8 @@ def _algorithmsPath(): # This function needs to be safe to run in order to populate the help page; that is, no app initialisation has been run def getList(): - import os, sys + import os from mrtrix3 import app - global _algorithm_list algorithm_list = [ ] src_file_list = os.listdir(_algorithmsPath()) for filename in src_file_list: @@ -39,7 +38,7 @@ def initialise(): initlist = [ ] base_parser = app.Parser(description='Base parser for construction of subparsers', parents=[app.cmdline]) subparsers = app.cmdline.add_subparsers(title='Algorithm choices', help='Select the algorithm to be used to complete the script operation; additional details and options become available once an algorithm is nominated. Options are: ' + ', '.join(getList()), dest='algorithm') - for importer, package_name, ispkg in pkgutil.iter_modules( [ _algorithmsPath() ] ): + for dummy_importer, package_name, dummy_ispkg in pkgutil.iter_modules( [ _algorithmsPath() ] ): module = importlib.import_module('mrtrix3.' + path.scriptSubDirName() + '.' + package_name) module.initialise(base_parser, subparsers) initlist.extend(package_name) @@ -52,4 +51,3 @@ def getModule(name): import sys from mrtrix3 import path return sys.modules['mrtrix3.' + path.scriptSubDirName() + '.' + name] - diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index d79964beb6..04937f8d8f 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -75,9 +75,8 @@ def init(author, synopsis): - import os + import os, signal global cmdline, config - global _signalData, _workingDir cmdline = Parser(author=author, synopsis=synopsis) _workingDir = os.getcwd() # Load the MRtrix configuration files here, and create a dictionary @@ -88,8 +87,10 @@ def init(author, synopsis): f = open (path, 'r') for line in f: line = line.strip().split(': ') - if len(line) != 2: continue - if line[0][0] == '#': continue + if len(line) != 2: + continue + if line[0][0] == '#': + continue config[line[0]] = line[1] except IOError: pass @@ -113,29 +114,25 @@ def parse(): sys.exit(1) if len(sys.argv) == 1: - cmdline._printHelp() + cmdline.printHelp() sys.exit(0) - - if sys.argv[-1] == '__print_full_usage__': - cmdline._printFullUsage() + elif sys.argv[-1] == '__print_full_usage__': + cmdline.printFullUsage() sys.exit(0) - - if sys.argv[-1] == '__print_synopsis__': + elif sys.argv[-1] == '__print_synopsis__': sys.stdout.write(cmdline.synopsis) sys.exit(0) - - if sys.argv[-1] == '__print_usage_markdown__': - cmdline._printUsageMarkdown() + elif sys.argv[-1] == '__print_usage_markdown__': + cmdline.printUsageMarkdown() sys.exit(0) - - if sys.argv[-1] == '__print_usage_rst__': - cmdline._printUsageRst() + elif sys.argv[-1] == '__print_usage_rst__': + cmdline.printUsageRst() sys.exit(0) args = cmdline.parse_args() if args.help: - cmdline._printHelp() + cmdline.printHelp() sys.exit(0) use_colour = True @@ -178,16 +175,16 @@ def checkOutputPath(path): return abspath = os.path.abspath(os.path.join(_workingDir, path)) if os.path.exists(abspath): - type = '' + output_type = '' if os.path.isfile(abspath): - type = ' file' + output_type = ' file' elif os.path.isdir(abspath): - type = ' directory' + output_type = ' directory' if args.force: - warn('Output' + type + ' \'' + path + '\' already exists; will be overwritten at script completion') + warn('Output' + output_type + ' \'' + path + '\' already exists; will be overwritten at script completion') force = True else: - error('Output' + type + ' \'' + path + '\' already exists (use -force to override)') + error('Output' + output_type + ' \'' + path + '\' already exists (use -force to override)') @@ -281,7 +278,8 @@ def debug(text): import inspect, os, sys global colourClear, colourDebug global _verbosity - if _verbosity <= 2: return + if _verbosity <= 2: + return if len(inspect.stack()) == 2: # debug() called directly from script being executed caller = inspect.getframeinfo(inspect.stack()[1][0]) origin = '(' + os.path.basename(caller.filename) + ':' + str(caller.lineno) + ')' @@ -330,32 +328,31 @@ def warn(text): import argparse class Parser(argparse.ArgumentParser): - def __init__(self, *args, **kwargs): - import sys + def __init__(self, *args_in, **kwargs_in): global _defaultCopyright - if 'author' in kwargs: - self._author = kwargs['author'] - del kwargs['author'] + if 'author' in kwargs_in: + self._author = kwargs_in['author'] + del kwargs_in['author'] else: self._author = None self._citationList = [ ] - if 'copyright' in kwargs: - self._copyright = kwargs['copyright'] - del kwargs['copyright'] + if 'copyright' in kwargs_in: + self._copyright = kwargs_in['copyright'] + del kwargs_in['copyright'] else: self._copyright = _defaultCopyright self._description = [ ] self._externalCitations = False - if 'synopsis' in kwargs: - self.synopsis = kwargs['synopsis'] - del kwargs['synopsis'] + if 'synopsis' in kwargs_in: + self.synopsis = kwargs_in['synopsis'] + del kwargs_in['synopsis'] else: self.synopsis = None - kwargs['add_help'] = False - argparse.ArgumentParser.__init__(self, *args, **kwargs) + kwargs_in['add_help'] = False + argparse.ArgumentParser.__init__(self, *args_in, **kwargs_in) self.mutuallyExclusiveOptionGroups = [ ] - if 'parents' in kwargs: - for parent in kwargs['parents']: + if 'parents' in kwargs_in: + for parent in kwargs_in['parents']: self._citationList.extend(parent._citationList) self._externalCitations = self._externalCitations or parent._externalCitations else: @@ -379,26 +376,25 @@ def addCitation(self, condition, reference, is_external): def addDescription(self, text): self._description.append(text) - def setCopyright(text): + def setCopyright(self, text): self._copyright = text # Mutually exclusive options need to be added before the command-line input is parsed def flagMutuallyExclusiveOptions(self, options, required=False): import sys - if not type(options) is list or not type(options[0]) is str: + if not isinstance(options, list) or not isinstance(options[0], str): sys.stderr.write('Script error: Parser.flagMutuallyExclusiveOptions() only accepts a list of strings\n') sys.stderr.flush() sys.exit(1) self.mutuallyExclusiveOptionGroups.append( (options, required) ) def parse_args(self): - import sys - args = argparse.ArgumentParser.parse_args(self) - self._checkMutuallyExclusiveOptions(args) + result = argparse.ArgumentParser.parse_args(self) + self._checkMutuallyExclusiveOptions(result) if self._subparsers: for alg in self._subparsers._group_actions[0].choices: - self._subparsers._group_actions[0].choices[alg]._checkMutuallyExclusiveOptions(args) - return args + self._subparsers._group_actions[0].choices[alg]._checkMutuallyExclusiveOptions(result) + return result def printCitationWarning(self): # If a subparser has been invoked, the subparser's function should instead be called, @@ -422,12 +418,12 @@ def printCitationWarning(self): # Overloads argparse.ArgumentParser function to give a better error message on failed parsing def error(self, text): import shlex, sys - for arg in sys.argv: - if '-help'.startswith(arg): - self._printHelp() + for entry in sys.argv: + if '-help'.startswith(entry): + self.printHelp() sys.exit(0) if self.prog and len(shlex.split(self.prog)) == len(sys.argv): # No arguments provided to subparser - self._printHelp() + self.printHelp() sys.exit(0) usage = self._formatUsage() if self._subparsers: @@ -441,7 +437,7 @@ def error(self, text): sys.stderr.flush() sys.exit(1) - def _checkMutuallyExclusiveOptions(self, args): + def _checkMutuallyExclusiveOptions(self, args_in): import sys for group in self.mutuallyExclusiveOptionGroups: count = 0 @@ -449,10 +445,10 @@ def _checkMutuallyExclusiveOptions(self, args): # Checking its presence is not adequate; by default, argparse adds these members to the namespace # Need to test if more than one of these options DIFFERS FROM ITS DEFAULT # Will need to loop through actions to find it manually - if hasattr(args, option): + if hasattr(args_in, option): for arg in self._actions: if arg.dest == option: - if not getattr(args, option) == arg.default: + if not getattr(args_in, option) == arg.default: count += 1 break if count > 1: @@ -467,7 +463,6 @@ def _checkMutuallyExclusiveOptions(self, args): sys.exit(1) def _formatUsage(self): - import sys argument_list = [ ] trailing_ellipsis = '' if self._subparsers: @@ -480,7 +475,7 @@ def _formatUsage(self): argument_list.append(arg.dest) return self.prog + ' ' + ' '.join(argument_list) + ' [ options ]' + trailing_ellipsis - def _printHelp(self): + def printHelp(self): import subprocess, textwrap def bold(text): @@ -602,7 +597,7 @@ def appVersion(): else: print (s) - def _printFullUsage(self): + def printFullUsage(self): import sys print (self.synopsis) if self._description: @@ -633,7 +628,7 @@ def _printFullUsage(self): else: print ('ARGUMENT ' + option.metavar + ' 0 0') - def _printUsageMarkdown(self): + def printUsageMarkdown(self): import os, subprocess, sys if self._subparsers and len(sys.argv) == 3: for alg in self._subparsers._group_actions[0].choices: @@ -700,7 +695,7 @@ def _printUsageMarkdown(self): for alg in self._subparsers._group_actions[0].choices: subprocess.call ([ sys.executable, os.path.realpath(sys.argv[0]), alg, '__print_usage_markdown__' ]) - def _printUsageRst(self): + def printUsageRst(self): import os, subprocess, sys # Need to check here whether it's the documentation for a particular subcmdline that's being requested if self._subparsers and len(sys.argv) == 3: @@ -791,6 +786,7 @@ def _printUsageRst(self): class progressBar: def _update(self): + import os, sys global clearLine, colourConsole, colourClear sys.stderr.write('\r' + colourConsole + os.path.basename(sys.argv[0]) + ': ' + colourClear + '[{0:>3}%] '.format(int(round(100.0*self.counter/self.target))) + self.message + '...' + clearLine + self.newline) sys.stderr.flush() @@ -812,6 +808,7 @@ def increment(self, msg=''): self._update() def done(self): + import os, sys global _verbosity global clearLine, colourConsole, colourClear self.counter = self.target @@ -832,7 +829,7 @@ def isWindows(): # Handler function for dealing with system signals -def _handler(signum, frame): +def _handler(signum, _frame): import os, signal, sys global _signals # First, kill any child processes @@ -859,4 +856,3 @@ def _handler(signum, frame): sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + colourError + msg + colourClear + '\n') complete() exit(signum) - diff --git a/lib/mrtrix3/dwi2response/dhollander.py b/lib/mrtrix3/dwi2response/dhollander.py index 92254319c7..0e006881aa 100644 --- a/lib/mrtrix3/dwi2response/dhollander.py +++ b/lib/mrtrix3/dwi2response/dhollander.py @@ -1,6 +1,5 @@ +#pylint: disable=unused-variable def initialise(base_parser, subparsers): - import argparse - from mrtrix3 import app parser = subparsers.add_parser('dhollander', author='Thijs Dhollander (thijs.dhollander@gmail.com)', synopsis='Unsupervised estimation of WM, GM and CSF response functions; does not require a T1 image (or segmentation thereof)', parents=[base_parser]) parser.addCitation('', 'Dhollander, T.; Raffelt, D. & Connelly, A. Unsupervised 3-tissue response function estimation from single-shell or multi-shell diffusion MR data without a co-registered T1 image. ISMRM Workshop on Breaking the Barriers of Diffusion MRI, 2016, 5', False) parser.add_argument('input', help='The input DWI') @@ -16,6 +15,7 @@ def initialise(base_parser, subparsers): +#pylint: disable=unused-variable def checkOutputPaths(): from mrtrix3 import app app.checkOutputPath(app.args.out_sfwm) @@ -24,25 +24,27 @@ def checkOutputPaths(): +#pylint: disable=unused-variable def getInputs(): pass +#pylint: disable=unused-variable def needsSingleShell(): return False +#pylint: disable=unused-variable def execute(): - import math, os, shutil + import shutil from mrtrix3 import app, image, path, run - # Get b-values and number of volumes per b-value. - bvalues = [ int(round(float(x))) for x in image.headerField('dwi.mif', 'shells').split() ] - bvolumes = [ int(x) for x in image.headerField('dwi.mif', 'shellcounts').split() ] + bvalues = [ int(round(float(x))) for x in image.mrinfo('dwi.mif', 'shells').split() ] + bvolumes = [ int(x) for x in image.mrinfo('dwi.mif', 'shellcounts').split() ] app.console(str(len(bvalues)) + ' unique b-value(s) detected: ' + ','.join(map(str,bvalues)) + ' with ' + ','.join(map(str,bvolumes)) + ' volumes.') if len(bvalues) < 2: app.error('Need at least 2 unique b-values (including b=0).') @@ -183,5 +185,3 @@ def execute(): run.command('mrcat crude_csf.mif crude_gm.mif crude_wm.mif crude.mif -axis 3') run.command('mrcat refined_csf.mif refined_gm.mif refined_wm.mif refined.mif -axis 3') run.command('mrcat voxels_csf.mif voxels_gm.mif voxels_sfwm.mif voxels.mif -axis 3') - - diff --git a/lib/mrtrix3/dwi2response/fa.py b/lib/mrtrix3/dwi2response/fa.py index b565f9f673..eb7b433703 100644 --- a/lib/mrtrix3/dwi2response/fa.py +++ b/lib/mrtrix3/dwi2response/fa.py @@ -1,6 +1,5 @@ +#pylint: disable=unused-variable def initialise(base_parser, subparsers): - import argparse - from mrtrix3 import app parser = subparsers.add_parser('fa', author='Robert E. Smith (robert.smith@florey.edu.au)', synopsis='Use the old FA-threshold heuristic for single-fibre voxel selection and response function estimation', parents=[base_parser]) parser.addCitation('', 'Tournier, J.-D.; Calamante, F.; Gadian, D. G. & Connelly, A. Direct estimation of the fiber orientation density function from diffusion-weighted MRI data using spherical deconvolution. NeuroImage, 2004, 23, 1176-1185', False) parser.add_argument('input', help='The input DWI') @@ -13,26 +12,30 @@ def initialise(base_parser, subparsers): +#pylint: disable=unused-variable def checkOutputPaths(): from mrtrix3 import app app.checkOutputPath(app.args.output) +#pylint: disable=unused-variable def getInputs(): pass +#pylint: disable=unused-variable def needsSingleShell(): return False +#pylint: disable=unused-variable def execute(): - import os, shutil + import shutil from mrtrix3 import app, image, path, run - bvalues = [ int(round(float(x))) for x in image.headerField('dwi.mif', 'shells').split() ] + bvalues = [ int(round(float(x))) for x in image.mrinfo('dwi.mif', 'shells').split() ] if len(bvalues) < 2: app.error('Need at least 2 unique b-values (including b=0).') lmax_option = '' @@ -52,4 +55,3 @@ def execute(): run.command('dwiextract dwi.mif - -singleshell -no_bzero | amp2response - voxels.mif vector.mif response.txt' + lmax_option) run.function(shutil.copyfile, 'response.txt', path.fromUser(app.args.output, False)) - diff --git a/lib/mrtrix3/dwi2response/manual.py b/lib/mrtrix3/dwi2response/manual.py index 43c0ffd731..e1f96f32ba 100644 --- a/lib/mrtrix3/dwi2response/manual.py +++ b/lib/mrtrix3/dwi2response/manual.py @@ -1,6 +1,5 @@ +#pylint: disable=unused-variable def initialise(base_parser, subparsers): - import argparse - from mrtrix3 import app parser = subparsers.add_parser('manual', author='Robert E. Smith (robert.smith@florey.edu.au)', synopsis='Derive a response function using an input mask image alone (i.e. pre-selected voxels)', parents=[base_parser]) parser.add_argument('input', help='The input DWI') parser.add_argument('in_voxels', help='Input voxel selection mask') @@ -10,12 +9,14 @@ def initialise(base_parser, subparsers): +#pylint: disable=unused-variable def checkOutputPaths(): from mrtrix3 import app app.checkOutputPath(app.args.output) +#pylint: disable=unused-variable def getInputs(): import os from mrtrix3 import app, path, run @@ -29,16 +30,18 @@ def getInputs(): +#pylint: disable=unused-variable def needsSingleShell(): return False +#pylint: disable=unused-variable def execute(): import os, shutil from mrtrix3 import app, image, path, run - shells = [ int(round(float(x))) for x in image.headerField('dwi.mif', 'shells').split() ] + shells = [ int(round(float(x))) for x in image.mrinfo('dwi.mif', 'shells').split() ] # Get lmax information (if provided) lmax = [ ] @@ -65,4 +68,3 @@ def execute(): run.function(shutil.copyfile, 'response.txt', path.fromUser(app.args.output, False)) run.function(shutil.copyfile, 'in_voxels.mif', 'voxels.mif') - diff --git a/lib/mrtrix3/dwi2response/msmt_5tt.py b/lib/mrtrix3/dwi2response/msmt_5tt.py index ca6fd3cab5..ed69d49166 100644 --- a/lib/mrtrix3/dwi2response/msmt_5tt.py +++ b/lib/mrtrix3/dwi2response/msmt_5tt.py @@ -1,6 +1,5 @@ +#pylint: disable=unused-variable def initialise(base_parser, subparsers): - import argparse - from mrtrix3 import app parser = subparsers.add_parser('msmt_5tt', author='Robert E. Smith (robert.smith@florey.edu.au)', synopsis='Derive MSMT-CSD tissue response functions based on a co-registered five-tissue-type (5TT) image', parents=[base_parser]) parser.addCitation('', 'Jeurissen, B.; Tournier, J.-D.; Dhollander, T.; Connelly, A. & Sijbers, J. Multi-tissue constrained spherical deconvolution for improved analysis of multi-shell diffusion MRI data. NeuroImage, 2014, 103, 411-426', False) parser.add_argument('input', help='The input DWI') @@ -16,6 +15,7 @@ def initialise(base_parser, subparsers): +#pylint: disable=unused-variable def checkOutputPaths(): from mrtrix3 import app app.checkOutputPath(app.args.out_wm) @@ -24,8 +24,8 @@ def checkOutputPaths(): +#pylint: disable=unused-variable def getInputs(): - import os from mrtrix3 import app, path, run run.command('mrconvert ' + path.fromUser(app.args.in_5tt, True) + ' ' + path.toTemp('5tt.mif', True)) if app.args.dirs: @@ -33,13 +33,15 @@ def getInputs(): +#pylint: disable=unused-variable def needsSingleShell(): return False +#pylint: disable=unused-variable def execute(): - import math, os, shutil + import os, shutil from mrtrix3 import app, image, path, run # Ideally want to use the oversampling-based regridding of the 5TT image from the SIFT model, not mrtransform @@ -49,7 +51,7 @@ def execute(): run.command('5ttcheck 5tt.mif', False) # Get shell information - shells = [ int(round(float(x))) for x in image.headerField('dwi.mif', 'shells').split() ] + shells = [ int(round(float(x))) for x in image.mrinfo('dwi.mif', 'shells').split() ] if len(shells) < 3: app.warn('Less than three b-value shells; response functions will not be applicable in resolving three tissues using MSMT-CSD algorithm') @@ -117,4 +119,3 @@ def execute(): # Generate output 4D binary image with voxel selections; RGB as in MSMT-CSD paper run.command('mrcat csf_mask.mif gm_mask.mif wm_sf_mask.mif voxels.mif -axis 3') - diff --git a/lib/mrtrix3/dwi2response/tax.py b/lib/mrtrix3/dwi2response/tax.py index 4f18576377..1f66e15139 100644 --- a/lib/mrtrix3/dwi2response/tax.py +++ b/lib/mrtrix3/dwi2response/tax.py @@ -1,6 +1,5 @@ +#pylint: disable=unused-variable def initialise(base_parser, subparsers): - import argparse - from mrtrix3 import app parser = subparsers.add_parser('tax', author='Robert E. Smith (robert.smith@florey.edu.au)', synopsis='Use the Tax et al. (2014) recursive calibration algorithm for single-fibre voxel selection and response function estimation', parents=[base_parser]) parser.addCitation('', 'Tax, C. M.; Jeurissen, B.; Vos, S. B.; Viergever, M. A. & Leemans, A. Recursive calibration of the fiber response function for spherical deconvolution of diffusion MRI data. NeuroImage, 2014, 86, 67-80', False) parser.add_argument('input', help='The input DWI') @@ -12,22 +11,26 @@ def initialise(base_parser, subparsers): +#pylint: disable=unused-variable def checkOutputPaths(): from mrtrix3 import app app.checkOutputPath(app.args.output) +#pylint: disable=unused-variable def getInputs(): pass +#pylint: disable=unused-variable def needsSingleShell(): return True +#pylint: disable=unused-variable def execute(): import math, os, shutil from mrtrix3 import app, file, image, path, run @@ -77,7 +80,7 @@ def execute(): run.command('mrconvert ' + prefix + 'amps.mif ' + prefix + 'second_peaks.mif -coord 3 1 -axes 0,1,2') file.delTemporary(prefix + 'amps.mif') run.command('fixel2voxel ' + prefix + 'fixel/directions.mif split_dir ' + prefix + 'all_dirs.mif') - file.delTempFolder(prefix + 'fixel') + file.delTemporary(prefix + 'fixel') run.command('mrconvert ' + prefix + 'all_dirs.mif ' + prefix + 'first_dir.mif -coord 3 0:2') file.delTemporary(prefix + 'all_dirs.mif') # Revise single-fibre voxel selection based on ratio of tallest to second-tallest peak @@ -125,4 +128,3 @@ def execute(): run.function(shutil.copyfile, 'iter' + str(app.args.max_iters-1) + '_SF.mif', 'voxels.mif') run.function(shutil.copyfile, 'response.txt', path.fromUser(app.args.output, False)) - diff --git a/lib/mrtrix3/dwi2response/tournier.py b/lib/mrtrix3/dwi2response/tournier.py index 789b837c2c..590a389791 100644 --- a/lib/mrtrix3/dwi2response/tournier.py +++ b/lib/mrtrix3/dwi2response/tournier.py @@ -1,6 +1,5 @@ +#pylint: disable=unused-variable def initialise(base_parser, subparsers): - import argparse - from mrtrix3 import app parser = subparsers.add_parser('tournier', author='Robert E. Smith (robert.smith@florey.edu.au)', synopsis='Use the Tournier et al. (2013) iterative algorithm for single-fibre voxel selection and response function estimation', parents=[base_parser]) parser.addCitation('', 'Tournier, J.-D.; Calamante, F. & Connelly, A. Determination of the appropriate b-value and number of gradient directions for high-angular-resolution diffusion-weighted imaging. NMR Biomedicine, 2013, 26, 1775-1786', False) parser.add_argument('input', help='The input DWI') @@ -13,22 +12,26 @@ def initialise(base_parser, subparsers): +#pylint: disable=unused-variable def checkOutputPaths(): from mrtrix3 import app app.checkOutputPath(app.args.output) +#pylint: disable=unused-variable def getInputs(): pass +#pylint: disable=unused-variable def needsSingleShell(): return True +#pylint: disable=unused-variable def execute(): import os, shutil from mrtrix3 import app, file, image, path, run @@ -48,7 +51,7 @@ def execute(): mask_in_path = 'mask.mif' init_RF = '1 -1 1' with open(RF_in_path, 'w') as f: - f.write(init_RF); + f.write(init_RF) iter_lmax_option = ' -lmax 4' else: RF_in_path = 'iter' + str(iteration-1) + '_RF.txt' @@ -58,8 +61,6 @@ def execute(): # Run CSD run.command('dwi2fod csd dwi.mif ' + RF_in_path + ' ' + prefix + 'FOD.mif -mask ' + mask_in_path + iter_lmax_option) # Get amplitudes of two largest peaks, and direction of largest - # TODO Speed-test fod2fixel against sh2peaks - # TODO Add maximum number of fixels per voxel option to fod2fixel? run.command('fod2fixel ' + prefix + 'FOD.mif ' + prefix + 'fixel -peak peaks.mif -mask ' + mask_in_path + ' -fmls_no_thresholds') file.delTemporary(prefix + 'FOD.mif') if iteration: @@ -69,7 +70,7 @@ def execute(): run.command('mrconvert ' + prefix + 'amps.mif ' + prefix + 'second_peaks.mif -coord 3 1 -axes 0,1,2') file.delTemporary(prefix + 'amps.mif') run.command('fixel2voxel ' + prefix + 'fixel/directions.mif split_dir ' + prefix + 'all_dirs.mif -number 1') - file.delTempFolder(prefix + 'fixel') + file.delTemporary(prefix + 'fixel') run.command('mrconvert ' + prefix + 'all_dirs.mif ' + prefix + 'first_dir.mif -coord 3 0:2') file.delTemporary(prefix + 'all_dirs.mif') # Calculate the 'cost function' Donald derived for selecting single-fibre voxels @@ -110,4 +111,3 @@ def execute(): run.function(shutil.move, 'iter' + str(app.args.max_iters-1) + '_SF.mif', 'voxels.mif') run.function(shutil.copyfile, 'response.txt', path.fromUser(app.args.output, False)) - diff --git a/lib/mrtrix3/file.py b/lib/mrtrix3/file.py index 8cbbd1c0d9..f8985363d6 100644 --- a/lib/mrtrix3/file.py +++ b/lib/mrtrix3/file.py @@ -12,20 +12,20 @@ def delTemporary(path): if not app._cleanup: return if os.path.isfile(path): - type = 'file' + temporary_type = 'file' func = os.remove elif os.path.isdir(path): - type = 'directory' + temporary_type = 'directory' func = shutil.rmtree else: app.debug('Unknown target \'' + path + '\'') return if app._verbosity > 2: - app.console('Deleting temporary ' + type + ': \'' + path + '\'') + app.console('Deleting temporary ' + temporary_type + ': \'' + path + '\'') try: func(path) except OSError: - app.debug('Unable to delete temporary ' + type + ': \'' + path + '\'') + app.debug('Unable to delete temporary ' + temporary_type + ': \'' + path + '\'') @@ -98,7 +98,7 @@ def inUse(path): if not os.access(path, os.W_OK): return None try: - with open(path, 'rb+') as f: + with open(path, 'rb+') as dummy_f: pass return False except: diff --git a/lib/mrtrix3/fsl.py b/lib/mrtrix3/fsl.py index 69f08a3809..1b4efe1a96 100644 --- a/lib/mrtrix3/fsl.py +++ b/lib/mrtrix3/fsl.py @@ -21,9 +21,9 @@ def eddyBinary(cuda): # Therefore, hunt through PATH looking for them; if more than one, # select the one with the highest version number binaries = [ ] - for dir in os.environ['PATH'].split(os.pathsep): - if os.path.isdir(dir): - for file in os.listdir(dir): + for directory in os.environ['PATH'].split(os.pathsep): + if os.path.isdir(directory): + for file in os.listdir(directory): if file.startswith('eddy_cuda'): binaries.append(file) max_version = 0.0 @@ -115,4 +115,3 @@ def suffix(): app.warn('Environment variable FSLOUTPUTTYPE not set; FSL commands may fail, or script may fail to locate FSL command outputs') _suffix = '.nii.gz' return _suffix - diff --git a/lib/mrtrix3/image.py b/lib/mrtrix3/image.py index d8baff270c..8a5bd57a09 100644 --- a/lib/mrtrix3/image.py +++ b/lib/mrtrix3/image.py @@ -31,9 +31,17 @@ def __init__(self, image_path): with open(filename, 'r') as f: elements = json.load(f) os.remove(filename) + self.name = self.format = self.datatype = '' + self.size = self.spacing = self.stride = [] + self.intensity_offset = 0.0 + self.intensity_scale = 1.0 + self.transform = [[]] + self.keyval = { } self.__dict__.update(elements) - if not self.keyval: - self.keyval = { } + #pylint: disable-msg=too-many-boolean-expressions + if not self.name or not self.size or not self.spacing or not self.stride or not \ + self.format or not self.datatype or not self.transform: + app.error('Error in reading header information from file \'' + image_path + '\'') def header(image_path): result = _Header(image_path) @@ -41,22 +49,42 @@ def header(image_path): +# Despite being able to import the entire image header contents using the header() +# function, there are still some functionalities in mrinfo that can prove useful. +# Therefore, provide this function to execute mrinfo and get just the information of +# interest. Note however that parsing the output of mrinfo e.g. into list / numerical +# form is not performed by this function. +def mrinfo(image_path, field): + import subprocess + from mrtrix3 import app, run + command = [ run.exeName(run.versionMatch('mrinfo')), image_path, '-' + field ] + if app._verbosity > 1: + app.console('Command: \'' + ' '.join(command) + '\' (piping data to local storage)') + proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=None) + result, dummy_err = proc.communicate() + result = result.rstrip().decode('utf-8') + if app._verbosity > 1: + app.console('Result: ' + result) + return result + + + # Check to see whether the fundamental header properties of two images match # Inputs can be either _Header class instances, or file paths def match(image_one, image_two): import math from mrtrix3 import app if not isinstance(image_one, _Header): - if not type(image_one) is str: + if not isinstance(image_one, str): app.error('Error trying to test \'' + str(image_one) + '\': Not an image header or file path') image_one = header(image_one) if not isinstance(image_two, _Header): - if not type(image_two) is str: + if not isinstance(image_two, str): app.error('Error trying to test \'' + str(image_two) + '\': Not an image header or file path') image_two = header(image_two) debug_prefix = '\'' + image_one.name + '\' \'' + image_two.name + '\'' # Image dimensions - if not image_one.size == image_two.size: + if image_one.size != image_two.size: app.debug(debug_prefix + ' dimension mismatch (' + str(image_one.size) + ' ' + str(image_two.size) + ')') return False # Voxel size @@ -77,18 +105,19 @@ def match(image_one, image_two): -def statistic(image_path, statistic, mask_path = ''): +# TODO Change mask_path to instead receive a string of additional command-line options +# (that way, -allvolumes can be used) +def statistic(image_path, stat, mask_path = ''): import subprocess from mrtrix3 import app, run - command = [ run.exeName(run.versionMatch('mrstats')), image_path, '-output', statistic ] + command = [ run.exeName(run.versionMatch('mrstats')), image_path, '-output', stat ] if mask_path: command.extend([ '-mask', mask_path ]) if app._verbosity > 1: app.console('Command: \'' + ' '.join(command) + '\' (piping data to local storage)') proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=None) - result, err = proc.communicate() + result, dummy_err = proc.communicate() result = result.rstrip().decode('utf-8') if app._verbosity > 1: app.console('Result: ' + result) return result - diff --git a/lib/mrtrix3/path.py b/lib/mrtrix3/path.py index 54a010b36a..599a0481fa 100644 --- a/lib/mrtrix3/path.py +++ b/lib/mrtrix3/path.py @@ -3,17 +3,17 @@ # Determines the common postfix for a list of filenames (including the file extension) def commonPostfix(inputFiles): from mrtrix3 import app - first = inputFiles[0]; + first = inputFiles[0] cursor = 0 - found = False; + found = False common = '' - for i in reversed(first): - if found == False: + for dummy_i in reversed(first): + if not found: for j in inputFiles: if j[len(j)-cursor-1] != first[len(first)-cursor-1]: found = True break - if found == False: + if not found: common = first[len(first)-cursor-1] + common cursor += 1 app.debug('Common postfix of ' + str(len(inputFiles)) + ' is \'' + common + '\'') @@ -69,10 +69,12 @@ def newTemporary(suffix): # This can be algorithm files in lib/mrtrix3, or data files in /share/mrtrix3/ def scriptSubDirName(): import inspect, os + from mrtrix3 import app # TODO Test this on multiple Python versions, with & without softlinking name = os.path.basename(inspect.stack()[-1][1]) if not name[0].isalpha(): name = '_' + name + app.debug(name) return name @@ -83,7 +85,10 @@ def scriptSubDirName(): # need to be used in conjunction with scriptSubDirName() def sharedDataPath(): import os - return os.path.realpath(os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir, os.pardir, 'share', 'mrtrix3'))) + from mrtrix3 import app + result = os.path.realpath(os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir, os.pardir, 'share', 'mrtrix3'))) + app.debug(result) + return result diff --git a/lib/mrtrix3/phaseEncoding.py b/lib/mrtrix3/phaseEncoding.py index b2e061f4e6..e5e1151107 100644 --- a/lib/mrtrix3/phaseEncoding.py +++ b/lib/mrtrix3/phaseEncoding.py @@ -1,7 +1,7 @@ # Functions relating to handling phase encoding information # From a user-specified string, determine the axis and direction of phase encoding -def dir(string): +def direction(string): from mrtrix3 import app pe_dir = '' try: @@ -49,21 +49,20 @@ def dir(string): # Extract a phase-encoding scheme from a pre-loaded image header, # or from a path to the image -def getScheme(input): +def getScheme(arg): from mrtrix3 import app, image - if not isinstance(input, image._Header): - if not (type(input) is str): - app.error('Error trying to derive phase-encoding scheme from \'' + str(input) + '\': Not an image header or file path') - input = image.header(input) - if 'pe_scheme' in input.keyval: - app.debug(input.keyval['pe_scheme']) - return input.keyval['pe_scheme'] - if not 'PhaseEncodingDirection' in input.keyval: + if not isinstance(arg, image._Header): + if not isinstance(arg, str): + app.error('Error trying to derive phase-encoding scheme from \'' + str(arg) + '\': Not an image header or file path') + arg = image.header(arg) + if 'pe_scheme' in arg.keyval: + app.debug(arg.keyval['pe_scheme']) + return arg.keyval['pe_scheme'] + if 'PhaseEncodingDirection' not in arg.keyval: return None - line = dir(input.keyval['PhaseEncodingDirection']) - if 'TotalReadoutTime' in input.keyval: - line.append(input.keyval['TotalReadoutTime']) - num_volumes = 1 if len(input.size()) < 4 else input.size[3] + line = direction(arg.keyval['PhaseEncodingDirection']) + if 'TotalReadoutTime' in arg.keyval: + line.append(arg.keyval['TotalReadoutTime']) + num_volumes = 1 if len(arg.size) < 4 else arg.size[3] app.debug(str(line) + ' x ' + num_volumes + ' rows') return line * num_volumes - diff --git a/lib/mrtrix3/run.py b/lib/mrtrix3/run.py index a1ccdef775..6666bf5104 100644 --- a/lib/mrtrix3/run.py +++ b/lib/mrtrix3/run.py @@ -9,11 +9,11 @@ def command(cmd, exitOnError=True): - import inspect, itertools, os, shlex, subprocess, sys, tempfile + import inspect, itertools, shlex, signal, subprocess, sys, tempfile from distutils.spawn import find_executable from mrtrix3 import app - global _mrtrix_exe_list + global _mrtrix_exe_list, _processes # Vectorise the command string, preserving anything encased within quotation marks cmdsplit = shlex.split(cmd) @@ -43,7 +43,7 @@ def command(cmd, exitOnError=True): # individual executable (along with its arguments) appears as its own list # Note that for Python2 support, it is necessary to convert groupby() output from # a generator to a list before it is passed to filter() - cmdstack = [ list(g) for k, g in filter(lambda t : t[0], ((k, list(g)) for k, g in itertools.groupby(cmdsplit, lambda s : s is not '|') ) ) ] + cmdstack = [ list(g) for k, g in filter(lambda t : t[0], ((k, list(g)) for k, g in itertools.groupby(cmdsplit, lambda s : s != '|') ) ) ] for line in cmdstack: is_mrtrix_exe = line[0] in _mrtrix_exe_list @@ -59,7 +59,7 @@ def command(cmd, exitOnError=True): else: line[0] = exeName(line[0]) shebang = _shebang(line[0]) - if len(shebang): + if shebang: if not is_mrtrix_exe: # If a shebang is found, and this call is therefore invoking an # interpreter, can't rely on the interpreter finding the script @@ -81,7 +81,7 @@ def command(cmd, exitOnError=True): # Execute all processes _processes = [ ] - for index, command in enumerate(cmdstack): + for index, to_execute in enumerate(cmdstack): file_out = None file_err = None # If there's at least one command prior to this, need to receive the stdout from the prior command @@ -107,21 +107,20 @@ def command(cmd, exitOnError=True): handle_err = file_err.fileno() # Set off the processes try: - process = subprocess.Popen (command, stdin=handle_in, stdout=handle_out, stderr=handle_err) + process = subprocess.Popen (to_execute, stdin=handle_in, stdout=handle_out, stderr=handle_err) _processes.append(process) tempfiles.append( ( file_out, file_err ) ) # FileNotFoundError not defined in Python 2.7 except OSError as e: if exitOnError: - app.error('\'' + command[0] + '\' not executed ("' + str(e) + '"); script cannot proceed') + app.error('\'' + to_execute[0] + '\' not executed ("' + str(e) + '"); script cannot proceed') else: - app.warn('\'' + command[0] + '\' not executed ("' + str(e) + '")') + app.warn('\'' + to_execute[0] + '\' not executed ("' + str(e) + '")') for p in _processes: p.terminate() _processes = [ ] break except (KeyboardInterrupt, SystemExit): - import inspect, signal app._handler(signal.SIGINT, inspect.currentframe()) return_stdout = '' @@ -154,7 +153,6 @@ def command(cmd, exitOnError=True): process.wait() except (KeyboardInterrupt, SystemExit): - import inspect, signal app._handler(signal.SIGINT, inspect.currentframe()) # For any command stdout / stderr data that wasn't either passed to another command or @@ -179,7 +177,7 @@ def command(cmd, exitOnError=True): _processes = [ ] - if (error): + if error: app._cleanup = False if exitOnError: caller = inspect.getframeinfo(inspect.stack()[1][0]) @@ -212,7 +210,7 @@ def command(cmd, exitOnError=True): def function(fn, *args): - import os, sys + import sys from mrtrix3 import app fnstring = fn.__module__ + '.' + fn.__name__ + '(' + ', '.join(args) + ')' @@ -261,7 +259,6 @@ def function(fn, *args): # When running on Windows, add the necessary '.exe' so that hopefully the correct # command is found by subprocess def exeName(item): - import os from distutils.spawn import find_executable from mrtrix3 import app global _mrtrix_bin_path @@ -291,7 +288,6 @@ def exeName(item): # (e.g. C:\Windows\system32\mrinfo.exe; On Windows, subprocess uses CreateProcess(), # which checks system32\ before PATH) def versionMatch(item): - import os from distutils.spawn import find_executable from mrtrix3 import app global _mrtrix_bin_path, _mrtrix_exe_list @@ -317,7 +313,6 @@ def versionMatch(item): # If the target executable is not a binary, but is actually a script, use the # shebang at the start of the file to alter the subprocess call def _shebang(item): - import os from mrtrix3 import app from distutils.spawn import find_executable # If a complete path has been provided rather than just a file name, don't perform any additional file search diff --git a/run_pylint b/run_pylint new file mode 100755 index 0000000000..b016fe6c4c --- /dev/null +++ b/run_pylint @@ -0,0 +1,84 @@ +#!/bin/bash + +LOGFILE=pylint.log +echo logging to \""$LOGFILE"\" + +cat > $LOGFILE <> $LOGFILE < .__tmp.log 2>&1 + + if [[ $? -ne 0 ]]; then + echo 'ERROR' + echo " [ ERROR ]" >> $LOGFILE + else + echo 'OK' + echo " [ ok ]" >> $LOGFILE + ((success++)) + fi + + cat .__tmp.log >> $LOGFILE + echo "" >> $LOGFILE + ((ntests++)) + +done + +if [[ ${success} -lt ${ntests} ]]; then + cat >> $LOGFILE <> $LOGFILE <?$ + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Maximum number of characters on a single line. +max-line-length=100 + +# Maximum number of lines in a module +max-module-lines=1000 + +# List of optional constructs for which whitespace checking is disabled. `dict- +# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. +# `trailing-comma` allows a space between comma and closing bracket: (a, ). +# `empty-line` allows space-only lines. +no-space-check=trailing-comma,dict-separator + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[CLASSES] + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__,__new__,setUp + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict,_fields,_replace,_source,_make + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + + +[DESIGN] + +# Maximum number of arguments for function / method +max-args=5 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Maximum number of boolean expressions in a if statement +max-bool-expr=5 + +# Maximum number of branch for function / method body +max-branches=12 + +# Maximum number of locals for function / method body +max-locals=15 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + +# Maximum number of return / yield for function / method body +max-returns=6 + +# Maximum number of statements in function / method body +max-statements=50 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + + +[IMPORTS] + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Deprecated modules which should not be used, separated by a comma +deprecated-modules=optparse,tkinter.tix + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled) +ext-import-graph= + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled) +import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled) +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when being caught. Defaults to +# "Exception" +overgeneral-exceptions=Exception From f2e91c852c05cb2d58824e51564d5cf071ab04d9 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 16 Aug 2017 11:09:46 +1000 Subject: [PATCH 064/538] Tweaks for pylint testing - Fixed issues in blend and convert_bruker scripts - Added bypass comments to prevent pylint erros in specific locations where the behaviour is intended; this includes library functions that are not invoked within that particular library file, but may be used elsewhere. - Minor tweaks to run_pylint script. --- bin/blend | 34 +++++++++++++++------------------- bin/convert_bruker | 24 ++++++++++++++++-------- lib/mrtrix3/algorithm.py | 4 +++- lib/mrtrix3/app.py | 22 ++++++++++++++++++---- lib/mrtrix3/file.py | 4 ++++ lib/mrtrix3/fsl.py | 4 ++++ lib/mrtrix3/image.py | 5 +++++ lib/mrtrix3/path.py | 6 ++++++ lib/mrtrix3/phaseEncoding.py | 2 ++ lib/mrtrix3/run.py | 3 ++- run_pylint | 24 ++++++++++++------------ 11 files changed, 87 insertions(+), 45 deletions(-) diff --git a/bin/blend b/bin/blend index 8677e9bd60..519b1e7fa8 100755 --- a/bin/blend +++ b/bin/blend @@ -1,14 +1,12 @@ #!/usr/bin/env python2 import os import sys -import string -import math if len(sys.argv) <= 1: - print ('A script to blend two sets of movie frames together with a desired overlap.') - print ('The input arguments are two folders containing the movie frames (eg. output from the MRview screenshot tool), and the desired number of overlapping frames.') - print ('eg: blend folder1 folder2 20 output_folder') - sys.exit(1) + print ('A script to blend two sets of movie frames together with a desired overlap.') + print ('The input arguments are two folders containing the movie frames (eg. output from the MRview screenshot tool), and the desired number of overlapping frames.') + print ('eg: blend folder1 folder2 20 output_folder') + sys.exit(1) input_folder1 = sys.argv[1] input_folder2 = sys.argv[2] @@ -18,19 +16,17 @@ num_overlap = int(sys.argv[3]) output_folder = sys.argv[4] if not os.path.exists(output_folder): - os.mkdir(output_folder) + os.mkdir(output_folder) total_num_output_frames = len(file_list1) + len(file_list2) - num_overlap for i in range(total_num_output_frames): - file_name = 'frame' + '%0*d' % (5, i) + '.png' - if (i <= (len(file_list1) - num_overlap)): - os.system('cp -L ' + input_folder1 + '/' + file_list1[i] + ' ' + output_folder + '/' + file_name) - if (i > (len(file_list1) - num_overlap)) and (i < (len(file_list1))): - i2 = i - (len(file_list1) - num_overlap) - 1 - blend_amount = 100 * float(i2 + 1) / float(num_overlap) - os.system('convert ' + input_folder1 + '/' + file_list1[i] + ' ' + input_folder2 + '/' + file_list2[i2] + ' -alpha on -compose blend -define compose:args=' + str(blend_amount) + ' -gravity South -composite ' + output_folder + '/' + file_name) - if (i >= (len(file_list1))): - i2 = i - (len(file_list1) - num_overlap) - 1 - os.system('cp -L ' + input_folder2 + '/' + file_list2[i2] + ' ' + output_folder + '/' + file_name) - - + file_name = 'frame' + '%0*d' % (5, i) + '.png' + if i <= (len(file_list1) - num_overlap): + os.system('cp -L ' + input_folder1 + '/' + file_list1[i] + ' ' + output_folder + '/' + file_name) + if i > (len(file_list1) - num_overlap) and i < (len(file_list1)): + i2 = i - (len(file_list1) - num_overlap) - 1 + blend_amount = 100 * float(i2 + 1) / float(num_overlap) + os.system('convert ' + input_folder1 + '/' + file_list1[i] + ' ' + input_folder2 + '/' + file_list2[i2] + ' -alpha on -compose blend -define compose:args=' + str(blend_amount) + ' -gravity South -composite ' + output_folder + '/' + file_name) + if i >= (len(file_list1)): + i2 = i - (len(file_list1) - num_overlap) - 1 + os.system('cp -L ' + input_folder2 + '/' + file_list2[i2] + ' ' + output_folder + '/' + file_name) diff --git a/bin/convert_bruker b/bin/convert_bruker index 1a63ac442b..9c2a60d212 100755 --- a/bin/convert_bruker +++ b/bin/convert_bruker @@ -62,13 +62,15 @@ with open (sys.argv[2], 'w') as f: f.write (',' + str(mat_size[2])) else: try: - dummy = nslices + #pylint: disable=pointless-statement + nslices f.write (',' + str(nslices)) except: pass try: - dummy = nacq + #pylint: disable=pointless-statement + nacq f.write (',' + str(nacq)) except: pass @@ -78,12 +80,14 @@ with open (sys.argv[2], 'w') as f: f.write (',' + str(res[2])) else: try: - dummy = slicethick + #pylint: disable=pointless-statement + slicethick f.write (',' + str(slicethick)) except: pass try: - dummy = nacq + #pylint: disable=pointless-statement + nacq f.write (',') except: pass @@ -101,12 +105,14 @@ with open (sys.argv[2], 'w') as f: f.write ('\nlayout: +0,+1') try: - dummy = nslices + #pylint: disable=pointless-statement + nslices f.write (',+2') except: pass try: - dummy = nacq + #pylint: disable=pointless-statement + nacq f.write (',+3') except: pass @@ -114,8 +120,10 @@ with open (sys.argv[2], 'w') as f: f.write ('\nfile: ' + sys.argv[1] + '\n') try: - dummy = bvec - dummy = bval + #pylint: disable=pointless-statement + bvec + #pylint: disable=pointless-statement + bval for n in range (0, len (bval)): f.write ('dw_scheme: ' + bvec[3*n] + ',' + bvec[3*n+1] + ',' + str(-float(bvec[3*n+2])) + ',' + bval[n] + '\n') except: diff --git a/lib/mrtrix3/algorithm.py b/lib/mrtrix3/algorithm.py index 7c07f3577b..4c050f9ec3 100644 --- a/lib/mrtrix3/algorithm.py +++ b/lib/mrtrix3/algorithm.py @@ -14,6 +14,7 @@ def _algorithmsPath(): # This function needs to be safe to run in order to populate the help page; that is, no app initialisation has been run +#pylint: disable=unused-variable def getList(): import os from mrtrix3 import app @@ -32,6 +33,7 @@ def getList(): # Note: This function essentially duplicates the current state of app.cmdline in order for command-line # options common to all algorithms of a particular script to be applicable once any particular sub-parser # is invoked. Therefore this function must be called _after_ all such options are set up. +#pylint: disable=unused-variable def initialise(): import importlib, pkgutil from mrtrix3 import app, path @@ -46,7 +48,7 @@ def initialise(): - +#pylint: disable=unused-variable def getModule(name): import sys from mrtrix3 import path diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index 04937f8d8f..45d04bbbef 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -27,6 +27,7 @@ args = '' cmdline = None config = { } +#pylint: disable=unused-variable force = False @@ -44,7 +45,9 @@ of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more details, see http://www.mrtrix.org/.''' +#pylint: disable=unused-variable _lastFile = '' +#pylint: disable=unused-variable _nthreads = None _tempDir = '' _verbosity = 1 # 0 = quiet; 1 = default; 2 = info; 3 = debug @@ -73,7 +76,7 @@ - +#pylint: disable=unused-variable def init(author, synopsis): import os, signal global cmdline, config @@ -103,6 +106,7 @@ def init(author, synopsis): +#pylint: disable=unused-variable def parse(): import os, sys global args, cmdline @@ -166,7 +170,7 @@ def parse(): - +#pylint: disable=unused-variable def checkOutputPath(path): import os global args, force @@ -188,7 +192,7 @@ def checkOutputPath(path): - +#pylint: disable=unused-variable def makeTempDir(): import os, random, string, sys global args, config @@ -224,6 +228,7 @@ def makeTempDir(): +#pylint: disable=unused-variable def gotoTempDir(): import os global _tempDir @@ -235,6 +240,7 @@ def gotoTempDir(): +#pylint: disable=unused-variable def complete(): import os, shutil, sys global _cleanup, _tempDir, _workingDir @@ -257,7 +263,6 @@ def complete(): - # A set of functions and variables for printing various information at the command-line. clearLine = '' colourClear = '' @@ -267,6 +272,7 @@ def complete(): colourExec = '' colourWarn = '' +#pylint: disable=unused-variable def console(text): import os, sys global colourClear, colourConsole @@ -274,6 +280,7 @@ def console(text): if _verbosity: sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + colourConsole + text + colourClear + '\n') +#pylint: disable=unused-variable def debug(text): import inspect, os, sys global colourClear, colourDebug @@ -299,6 +306,7 @@ def debug(text): origin = funcname + ' (from ' + os.path.basename(caller.filename) + ':' + str(caller.lineno) + ')' sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + colourDebug + '[DEBUG] ' + origin + ': ' + text + colourClear + '\n') +#pylint: disable=unused-variable def error(text): import os, sys global colourClear, colourError @@ -308,6 +316,7 @@ def error(text): complete() sys.exit(1) +#pylint: disable=unused-variable def warn(text): import os, sys global colourClear, colourWarn @@ -368,18 +377,22 @@ def __init__(self, *args_in, **kwargs_in): standard_options.add_argument('-debug', action='store_true', help='Display additional debugging information over and above the output of -info') self.flagMutuallyExclusiveOptions( [ 'quiet', 'info', 'debug' ] ) + #pylint: disable=unused-variable def addCitation(self, condition, reference, is_external): self._citationList.append( (condition, reference) ) if is_external: self._externalCitations = True + #pylint: disable=unused-variable def addDescription(self, text): self._description.append(text) + #pylint: disable=unused-variable def setCopyright(self, text): self._copyright = text # Mutually exclusive options need to be added before the command-line input is parsed + #pylint: disable=unused-variable def flagMutuallyExclusiveOptions(self, options, required=False): import sys if not isinstance(options, list) or not isinstance(options[0], str): @@ -820,6 +833,7 @@ def done(self): # Return a boolean flag to indicate whether or not script is being run on a Windows machine +#pylint: disable=unused-variable def isWindows(): import platform system = platform.system().lower() diff --git a/lib/mrtrix3/file.py b/lib/mrtrix3/file.py index f8985363d6..7a634aa00a 100644 --- a/lib/mrtrix3/file.py +++ b/lib/mrtrix3/file.py @@ -6,6 +6,7 @@ # that is no longer required by the script. If the script has been instructed to retain # all temporaries, the resource will be retained; if not, it will be deleted (in particular # to dynamically free up storage space used by the script). +#pylint: disable=unused-variable def delTemporary(path): import shutil, os from mrtrix3 import app @@ -30,6 +31,7 @@ def delTemporary(path): # Make a directory if it doesn't exist; don't do anything if it does already exist +#pylint: disable=unused-variable def makeDir(path): import errno, os from mrtrix3 import app @@ -45,6 +47,7 @@ def makeDir(path): # Get an appropriate location and name for a new temporary file # Note: Doesn't actually create a file; just gives a unique name that won't over-write anything +#pylint: disable=unused-variable def newTempFile(suffix): import os, random, string, sys from mrtrix3 import app @@ -87,6 +90,7 @@ def newTempFile(suffix): # Initially, checks for the file once every 1/1000th of a second; this gradually # increases if the file still doesn't exist, until the program is only checking # for the file once a minute. +#pylint: disable=unused-variable def waitFor(path): import os, time from mrtrix3 import app diff --git a/lib/mrtrix3/fsl.py b/lib/mrtrix3/fsl.py index 1b4efe1a96..7e5e0beec9 100644 --- a/lib/mrtrix3/fsl.py +++ b/lib/mrtrix3/fsl.py @@ -6,6 +6,7 @@ # this depends on both whether or not the user has requested that the CUDA # version of eddy be used, and the various names that this command could # conceivably be installed as. +#pylint: disable=unused-variable def eddyBinary(cuda): import os from mrtrix3 import app @@ -53,6 +54,7 @@ def eddyBinary(cuda): # makes it more convenient to locate these commands. # Note that if FSL 4 and 5 are installed side-by-side, the approach taken in this # function will select the version 5 executable. +#pylint: disable=unused-variable def exeName(name): from mrtrix3 import app from distutils.spawn import find_executable @@ -71,6 +73,7 @@ def exeName(name): # FSL commands will generate based on the suffix() function, the FSL binaries themselves # ignore the FSLOUTPUTTYPE environment variable. Therefore, the safest approach is: # Whenever receiving an output image from an FSL command, explicitly search for the path +#pylint: disable=unused-variable def findImage(name): import os from mrtrix3 import app @@ -90,6 +93,7 @@ def findImage(name): # stored in 'FSLOUTPUTTYPE'. This may even override a filename extension provided # to the relevant command. Therefore use this function to 'guess' what the names # of images provided by FSL commands will be. +#pylint: disable=unused-variable def suffix(): import os from mrtrix3 import app diff --git a/lib/mrtrix3/image.py b/lib/mrtrix3/image.py index 8a5bd57a09..bd17f85c4e 100644 --- a/lib/mrtrix3/image.py +++ b/lib/mrtrix3/image.py @@ -3,6 +3,7 @@ # data, rather than trying to duplicate support for all possible image formats natively # in Python. +#pylint: disable=unused-variable def check3DNonunity(image_path): from mrtrix3 import app dim = header(image_path).size @@ -43,6 +44,7 @@ def __init__(self, image_path): self.format or not self.datatype or not self.transform: app.error('Error in reading header information from file \'' + image_path + '\'') +#pylint: disable=unused-variable def header(image_path): result = _Header(image_path) return result @@ -54,6 +56,7 @@ def header(image_path): # Therefore, provide this function to execute mrinfo and get just the information of # interest. Note however that parsing the output of mrinfo e.g. into list / numerical # form is not performed by this function. +#pylint: disable=unused-variable def mrinfo(image_path, field): import subprocess from mrtrix3 import app, run @@ -71,6 +74,7 @@ def mrinfo(image_path, field): # Check to see whether the fundamental header properties of two images match # Inputs can be either _Header class instances, or file paths +#pylint: disable=unused-variable def match(image_one, image_two): import math from mrtrix3 import app @@ -107,6 +111,7 @@ def match(image_one, image_two): # TODO Change mask_path to instead receive a string of additional command-line options # (that way, -allvolumes can be used) +#pylint: disable=unused-variable def statistic(image_path, stat, mask_path = ''): import subprocess from mrtrix3 import app, run diff --git a/lib/mrtrix3/path.py b/lib/mrtrix3/path.py index 599a0481fa..10b90e9a0d 100644 --- a/lib/mrtrix3/path.py +++ b/lib/mrtrix3/path.py @@ -1,6 +1,7 @@ # A collection of functions used to operate upon file and directory paths # Determines the common postfix for a list of filenames (including the file extension) +#pylint: disable=unused-variable def commonPostfix(inputFiles): from mrtrix3 import app first = inputFiles[0] @@ -28,6 +29,7 @@ def commonPostfix(inputFiles): # To add quotation marks where the output path is being interpreted as part of a full command string # (e.g. to be passed to run.command()); without these quotation marks, paths that include spaces would be # erroneously split, subsequently confusing whatever command is being invoked. +#pylint: disable=unused-variable def fromUser(filename, is_command): import os from mrtrix3 import app @@ -42,6 +44,7 @@ def fromUser(filename, is_command): # Get an appropriate location and name for a new temporary file / directory # Note: Doesn't actually create anything; just gives a unique name that won't over-write anything +#pylint: disable=unused-variable def newTemporary(suffix): import os, random, string, sys from mrtrix3 import app @@ -67,6 +70,7 @@ def newTemporary(suffix): # Determine the name of a sub-directory containing additional data / source files for a script # This can be algorithm files in lib/mrtrix3, or data files in /share/mrtrix3/ +#pylint: disable=unused-variable def scriptSubDirName(): import inspect, os from mrtrix3 import app @@ -83,6 +87,7 @@ def scriptSubDirName(): # Some scripts come with additional requisite data files; this function makes it easy to find them. # For data that is stored in a named sub-directory specifically for a particular script, this function will # need to be used in conjunction with scriptSubDirName() +#pylint: disable=unused-variable def sharedDataPath(): import os from mrtrix3 import app @@ -93,6 +98,7 @@ def sharedDataPath(): # Get the full absolute path to a location in the temporary script directory +#pylint: disable=unused-variable def toTemp(filename, is_command): import os from mrtrix3 import app diff --git a/lib/mrtrix3/phaseEncoding.py b/lib/mrtrix3/phaseEncoding.py index e5e1151107..7c54933881 100644 --- a/lib/mrtrix3/phaseEncoding.py +++ b/lib/mrtrix3/phaseEncoding.py @@ -1,6 +1,7 @@ # Functions relating to handling phase encoding information # From a user-specified string, determine the axis and direction of phase encoding +#pylint: disable=unused-variable def direction(string): from mrtrix3 import app pe_dir = '' @@ -49,6 +50,7 @@ def direction(string): # Extract a phase-encoding scheme from a pre-loaded image header, # or from a path to the image +#pylint: disable=unused-variable def getScheme(arg): from mrtrix3 import app, image if not isinstance(arg, image._Header): diff --git a/lib/mrtrix3/run.py b/lib/mrtrix3/run.py index 6666bf5104..236da1d999 100644 --- a/lib/mrtrix3/run.py +++ b/lib/mrtrix3/run.py @@ -7,6 +7,7 @@ +#pylint: disable=unused-variable def command(cmd, exitOnError=True): import inspect, itertools, shlex, signal, subprocess, sys, tempfile @@ -207,7 +208,7 @@ def command(cmd, exitOnError=True): - +#pylint: disable=unused-variable def function(fn, *args): import sys diff --git a/run_pylint b/run_pylint index b016fe6c4c..df1352237f 100755 --- a/run_pylint +++ b/run_pylint @@ -1,7 +1,7 @@ #!/bin/bash LOGFILE=pylint.log -echo logging to \""$LOGFILE"\" +echo logging to \""$LOGFILE"\" cat > $LOGFILE <> $LOGFILE < .__tmp.log 2>&1 - + if [[ $? -ne 0 ]]; then echo 'ERROR' echo " [ ERROR ]" >> $LOGFILE - else + else echo 'OK' echo " [ ok ]" >> $LOGFILE ((success++)) fi - + cat .__tmp.log >> $LOGFILE echo "" >> $LOGFILE ((ntests++)) @@ -71,13 +71,13 @@ done if [[ ${success} -lt ${ntests} ]]; then cat >> $LOGFILE <> $LOGFILE < Date: Wed, 16 Aug 2017 14:47:57 +1000 Subject: [PATCH 065/538] Scripts: Further changes for pylint testing - In app module, change a lot of globals to public, since many of them need to be accessed by other modules. - For single-line pylint exclusions, they need to appear at the end of the line itself; specifying them before the line results in a setting override for that scope block. - image.header() no longer returns a _Header class, but a generic Python object as returned by the json module, containing the relevant named variables. testing whether or not an object coresponds to an image heder is now done by testing for the presence of these members, rather than a class instance test. - Various testing tweaks and fixes to more-or-less clean up the test results. --- bin/5ttgen | 2 +- bin/dwi2response | 2 +- bin/dwibiascorrect | 4 +- bin/dwiintensitynorm | 10 +- bin/dwipreproc | 2 +- bin/labelsgmfix | 6 +- bin/population_template | 10 +- lib/mrtrix3/_5ttgen/freesurfer.py | 14 +- lib/mrtrix3/_5ttgen/fsl.py | 12 +- lib/mrtrix3/algorithm.py | 9 +- lib/mrtrix3/app.py | 258 ++++++++++++------------- lib/mrtrix3/dwi2response/dhollander.py | 19 +- lib/mrtrix3/dwi2response/fa.py | 15 +- lib/mrtrix3/dwi2response/manual.py | 15 +- lib/mrtrix3/dwi2response/msmt_5tt.py | 19 +- lib/mrtrix3/dwi2response/tax.py | 15 +- lib/mrtrix3/dwi2response/tournier.py | 15 +- lib/mrtrix3/file.py | 22 +-- lib/mrtrix3/fsl.py | 12 +- lib/mrtrix3/image.py | 103 +++++----- lib/mrtrix3/path.py | 30 ++- lib/mrtrix3/phaseEncoding.py | 8 +- lib/mrtrix3/run.py | 62 +++--- 23 files changed, 301 insertions(+), 363 deletions(-) diff --git a/bin/5ttgen b/bin/5ttgen index b79c31a34e..a629fa8024 100755 --- a/bin/5ttgen +++ b/bin/5ttgen @@ -50,5 +50,5 @@ stderr = run.command('5ttcheck result.mif', False)[1] if stderr and 'ERROR' in stderr: app.warn('Generated image does not perfectly conform to 5TT format') -run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + (' -force' if app.force else '')) +run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + (' -force' if app.forceOverwrite else '')) app.complete() diff --git a/bin/dwi2response b/bin/dwi2response index 6be360593a..f3fe6b02ee 100755 --- a/bin/dwi2response +++ b/bin/dwi2response @@ -108,5 +108,5 @@ alg.execute() # Finalize for all algorithms if app.args.voxels: - run.command('mrconvert voxels.mif ' + path.fromUser(app.args.voxels, True) + (' -force' if app.force else '')) + run.command('mrconvert voxels.mif ' + path.fromUser(app.args.voxels, True) + (' -force' if app.forceOverwrite else '')) app.complete() diff --git a/bin/dwibiascorrect b/bin/dwibiascorrect index 7dfa6ce827..0ac1dced5c 100755 --- a/bin/dwibiascorrect +++ b/bin/dwibiascorrect @@ -111,7 +111,7 @@ elif app.args.ants: run.command('N4BiasFieldCorrection -d 3 -i mean_bzero.nii -w mask.nii -o [corrected.nii,' + bias_path + '] -b [150,3] -c [1000x1000,0.0]') run.command('mrcalc in.mif ' + bias_path + ' -div result.mif') -run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + (' -force' if app.force else '')) +run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + (' -force' if app.forceOverwrite else '')) if app.args.bias: - run.command('mrconvert ' + bias_path + ' ' + path.fromUser(app.args.bias, True) + (' -force' if app.force else '')) + run.command('mrconvert ' + bias_path + ' ' + path.fromUser(app.args.bias, True) + (' -force' if app.forceOverwrite else '')) app.complete() diff --git a/bin/dwiintensitynorm b/bin/dwiintensitynorm index 9bd0bf7a4e..fa5de4348e 100755 --- a/bin/dwiintensitynorm +++ b/bin/dwiintensitynorm @@ -17,7 +17,7 @@ def abspath(*arg): return os.path.abspath(os.path.join(*arg)) def relpath(*arg): - return os.path.relpath(os.path.join(*arg), app._workingDir) + return os.path.relpath(os.path.join(*arg), app.workingDir) @@ -80,7 +80,7 @@ file.makeDir(app.args.output_dir) app.makeTempDir() -maskTempDir = os.path.join(app._tempDir, os.path.basename(os.path.normpath(maskDir))) +maskTempDir = os.path.join(app.tempDir, os.path.basename(os.path.normpath(maskDir))) run.command ('cp -R -L ' + maskDir + ' ' + maskTempDir) app.gotoTempDir() @@ -97,9 +97,9 @@ run.command('mrthreshold fa_template.mif -abs ' + app.args.fa_threshold + ' tem file.makeDir('wm_mask_warped') for i in input_list: run.command('mrtransform template_wm_mask.mif -interp nearest -warp_full ' + os.path.join('population_template', 'warps', i.prefix + '.mif') + ' ' + os.path.join('wm_mask_warped', i.prefix + '.mif') + ' -from 2 -template ' + os.path.join('fa', i.prefix + '.mif')) - run.command('dwinormalise ' + abspath(i.directory, i.filename) + ' ' + os.path.join('wm_mask_warped', i.prefix + '.mif') + ' ' + path.fromUser(os.path.join(app.args.output_dir, i.filename), True) + (' -force' if app.force else '')) + run.command('dwinormalise ' + abspath(i.directory, i.filename) + ' ' + os.path.join('wm_mask_warped', i.prefix + '.mif') + ' ' + path.fromUser(os.path.join(app.args.output_dir, i.filename), True) + (' -force' if app.forceOverwrite else '')) -run.command('mrconvert template_wm_mask.mif ' + path.fromUser(app.args.wm_mask, True) + (' -force' if app.force else '')) -run.command('mrconvert fa_template.mif ' + path.fromUser(app.args.fa_template, True) + (' -force' if app.force else '')) +run.command('mrconvert template_wm_mask.mif ' + path.fromUser(app.args.wm_mask, True) + (' -force' if app.forceOverwrite else '')) +run.command('mrconvert fa_template.mif ' + path.fromUser(app.args.fa_template, True) + (' -force' if app.forceOverwrite else '')) app.complete() diff --git a/bin/dwipreproc b/bin/dwipreproc index 9a9374dfc4..bc1d873c84 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -663,5 +663,5 @@ else: # Finish! -run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + grad_export_option + (' -force' if app.force else '')) +run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + grad_export_option + (' -force' if app.forceOverwrite else '')) app.complete() diff --git a/bin/labelsgmfix b/bin/labelsgmfix index 01ba69f93a..ed91e82bb9 100755 --- a/bin/labelsgmfix +++ b/bin/labelsgmfix @@ -104,7 +104,7 @@ for key, value in structure_map.items(): # Add to the SGM image; don't worry about overlap for now node_index = sgm_lut[value] run.command('mrcalc ' + image_path + ' ' + node_index + ' sgm.mif -if sgm_new.mif') - if not app._lastFile: + if not app.lastFile: run.function(os.remove, 'sgm.mif') run.function(os.rename, 'sgm_new.mif', 'sgm.mif') @@ -123,12 +123,12 @@ for struct in structure_map: image_path = struct + '_mask.mif' index = image.statistic('sgm_new_labels.mif', 'median', image_path) run.command('mrcalc parc.mif ' + index + ' -eq 0 parc.mif -if parc_removed.mif') - if not app._lastFile: + if not app.lastFile: run.function(os.remove, 'parc.mif') run.function(os.rename, 'parc_removed.mif', 'parc.mif') # Insert the new delineations of all SGM structures in a single call # Enforce unsigned integer datatype of output image run.command('mrcalc sgm_new_labels.mif 0.5 -gt sgm_new_labels.mif parc.mif -if result.mif -datatype uint32') -run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + (' -force' if app.force else '')) +run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + (' -force' if app.forceOverwrite else '')) app.complete() diff --git a/bin/population_template b/bin/population_template index f3c66ec2a5..f144f8475b 100755 --- a/bin/population_template +++ b/bin/population_template @@ -36,7 +36,7 @@ def abspath(*arg): return os.path.abspath(os.path.join(*arg)) def relpath(*arg): - return os.path.relpath(os.path.join(*arg), app._workingDir) + return os.path.relpath(os.path.join(*arg), app.workingDir) def allindir(directory): return ' '.join( [ os.path.join(directory, file) for file in os.listdir(directory) ] ) @@ -436,7 +436,7 @@ for level in range(0, len(nl_scales)): if useMasks: file.makeDir('masks_transformed') -write_log = (app._verbosity >= 2) +write_log = (app.verbosity >= 2) if write_log: file.makeDir('log') @@ -574,7 +574,7 @@ else: lmax = ' -noreorientation' if linear_estimator: metric = ' -rigid_metric.diff.estimator ' + linear_estimator - if app._verbosity >= 2: + if app.verbosity >= 2: mrregister_log = ' -info -rigid_log ' + os.path.join('log', i.filename + "_" + str(level) + '.log') else: scale = ' -affine_scale ' + str(linear_scales[level]) @@ -714,7 +714,7 @@ if dononlinear: run.function(move, os.path.join('warps_' + str(level), '%s.mif' % i.prefix), 'warps') -run.command('mrconvert ' + current_template + ' ' + path.fromUser(app.args.template, True) + (' -force' if app.force else '')) +run.command('mrconvert ' + current_template + ' ' + path.fromUser(app.args.template, True) + (' -force' if app.forceOverwrite else '')) if app.args.warp_dir: warp_path = path.fromUser(app.args.warp_dir, False) @@ -735,6 +735,6 @@ if app.args.transformed_dir: run.function(copytree, 'inputs_transformed', transformed_path) if app.args.template_mask: - run.command('mrconvert ' + current_template_mask + ' ' + path.fromUser(app.args.template_mask, True) + (' -force' if app.force else '')) + run.command('mrconvert ' + current_template_mask + ' ' + path.fromUser(app.args.template_mask, True) + (' -force' if app.forceOverwrite else '')) app.complete() diff --git a/lib/mrtrix3/_5ttgen/freesurfer.py b/lib/mrtrix3/_5ttgen/freesurfer.py index ea83a8aff8..909c36ab5e 100644 --- a/lib/mrtrix3/_5ttgen/freesurfer.py +++ b/lib/mrtrix3/_5ttgen/freesurfer.py @@ -1,5 +1,4 @@ -#pylint: disable=unused-variable -def initialise(base_parser, subparsers): +def initialise(base_parser, subparsers): #pylint: disable=unused-variable parser = subparsers.add_parser('freesurfer', author='Robert E. Smith (robert.smith@florey.edu.au)', synopsis='Generate the 5TT image based on a FreeSurfer parcellation image', parents=[base_parser]) parser.add_argument('input', help='The input FreeSurfer parcellation image (any image containing \'aseg\' in its name)') parser.add_argument('output', help='The output 5TT image') @@ -8,14 +7,12 @@ def initialise(base_parser, subparsers): -#pylint: disable=unused-variable -def checkOutputPaths(): +def checkOutputPaths(): #pylint: disable=unused-variable pass -#pylint: disable=unused-variable -def getInputs(): +def getInputs(): #pylint: disable=unused-variable import shutil from mrtrix3 import app, path, run run.command('mrconvert ' + path.fromUser(app.args.input, True) + ' ' + path.toTemp('input.mif', True)) @@ -24,9 +21,8 @@ def getInputs(): -#pylint: disable=unused-variable -def execute(): - import os, sys +def execute(): #pylint: disable=unused-variable + import os.path #pylint: disable=unused-variable from mrtrix3 import app, path, run lut_input_path = 'LUT.txt' diff --git a/lib/mrtrix3/_5ttgen/fsl.py b/lib/mrtrix3/_5ttgen/fsl.py index 5aaf122b91..5402205152 100644 --- a/lib/mrtrix3/_5ttgen/fsl.py +++ b/lib/mrtrix3/_5ttgen/fsl.py @@ -1,5 +1,4 @@ -#pylint: disable=unused-variable -def initialise(base_parser, subparsers): +def initialise(base_parser, subparsers): #pylint: disable=unused-variable parser = subparsers.add_parser('fsl', author='Robert E. Smith (robert.smith@florey.edu.au)', synopsis='Use FSL commands to generate the 5TT image based on a T1-weighted image', parents=[base_parser]) parser.addCitation('', 'Smith, S. M. Fast robust automated brain extraction. Human Brain Mapping, 2002, 17, 143-155', True) parser.addCitation('', 'Zhang, Y.; Brady, M. & Smith, S. Segmentation of brain MR images through a hidden Markov random field model and the expectation-maximization algorithm. IEEE Transactions on Medical Imaging, 2001, 20, 45-57', True) @@ -15,14 +14,12 @@ def initialise(base_parser, subparsers): -#pylint: disable=unused-variable -def checkOutputPaths(): +def checkOutputPaths(): #pylint: disable=unused-variable pass -#pylint: disable=unused-variable -def getInputs(): +def getInputs(): #pylint: disable=unused-variable from mrtrix3 import app, image, path, run image.check3DNonunity(path.fromUser(app.args.input, False)) run.command('mrconvert ' + path.fromUser(app.args.input, True) + ' ' + path.toTemp('input.mif', True)) @@ -36,8 +33,7 @@ def getInputs(): -#pylint: disable=unused-variable -def execute(): +def execute(): #pylint: disable=unused-variable import os from mrtrix3 import app, file, fsl, image, path, run diff --git a/lib/mrtrix3/algorithm.py b/lib/mrtrix3/algorithm.py index 4c050f9ec3..c706700ce0 100644 --- a/lib/mrtrix3/algorithm.py +++ b/lib/mrtrix3/algorithm.py @@ -14,8 +14,7 @@ def _algorithmsPath(): # This function needs to be safe to run in order to populate the help page; that is, no app initialisation has been run -#pylint: disable=unused-variable -def getList(): +def getList(): #pylint: disable=unused-variable import os from mrtrix3 import app algorithm_list = [ ] @@ -33,8 +32,7 @@ def getList(): # Note: This function essentially duplicates the current state of app.cmdline in order for command-line # options common to all algorithms of a particular script to be applicable once any particular sub-parser # is invoked. Therefore this function must be called _after_ all such options are set up. -#pylint: disable=unused-variable -def initialise(): +def initialise(): #pylint: disable=unused-variable import importlib, pkgutil from mrtrix3 import app, path initlist = [ ] @@ -48,8 +46,7 @@ def initialise(): -#pylint: disable=unused-variable -def getModule(name): +def getModule(name): #pylint: disable=unused-variable import sys from mrtrix3 import path return sys.modules['mrtrix3.' + path.scriptSubDirName() + '.' + name] diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index 45d04bbbef..4452adc4f2 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -24,16 +24,35 @@ # - 'force' will be True if the user has requested for existing output files to be # re-written, and at least one output target already exists # - 'mrtrix' provides functionality for interfacing with other MRtrix3 components +# TODO Create class for Continue: Have resume() function that mrtrix3.run can call, +# rather than directly overwriting the lastFile variable +# TODO Create named tuple for colours, all settings? args = '' +cleanup = True cmdline = None config = { } -#pylint: disable=unused-variable -force = False +forceOverwrite = False #pylint: disable=unused-variable +lastFile = '' #pylint: disable=unused-variable +numThreads = None #pylint: disable=unused-variable +tempDir = '' +verbosity = 1 # 0 = quiet; 1 = default; 2 = info; 3 = debug +workingDir = '' + + + + +clearLine = '' +colourClear = '' +colourConsole = '' +colourDebug = '' +colourError = '' +colourExec = '' #pylint: disable=unused-variable +colourWarn = '' + + -# These are used to configure the script interface and operation, and should not typically be accessed/modified directly -_cleanup = True _defaultCopyright = '''Copyright (c) 2008-2017 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public @@ -45,17 +64,9 @@ of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more details, see http://www.mrtrix.org/.''' -#pylint: disable=unused-variable -_lastFile = '' -#pylint: disable=unused-variable -_nthreads = None -_tempDir = '' -_verbosity = 1 # 0 = quiet; 1 = default; 2 = info; 3 = debug -_workingDir = '' -# Data used for setting up signal handlers _signals = { 'SIGALRM': 'Timer expiration', 'SIGBUS' : 'Bus error: Accessing invalid address (out of storage space?)', 'SIGFPE' : 'Floating-point arithmetic exception', @@ -76,12 +87,13 @@ -#pylint: disable=unused-variable -def init(author, synopsis): + + +def init(author, synopsis): #pylint: disable=unused-variable import os, signal - global cmdline, config + global cmdline, config, workingDir cmdline = Parser(author=author, synopsis=synopsis) - _workingDir = os.getcwd() + workingDir = os.getcwd() # Load the MRtrix configuration files here, and create a dictionary # Load system config first, user second: Allows user settings to override for path in [ os.path.join(os.path.sep, 'etc', 'mrtrix.conf'), @@ -100,17 +112,15 @@ def init(author, synopsis): # Set up signal handlers for s in _signals: try: - signal.signal(getattr(signal, s), _handler) + signal.signal(getattr(signal, s), handler) except: pass -#pylint: disable=unused-variable -def parse(): +def parse(): #pylint: disable=unused-variable import os, sys - global args, cmdline - global _cleanup, _lastFile, _nthreads, _tempDir, _verbosity + global args, cleanup, cmdline, lastFile, numThreads, tempDir, verbosity global clearLine, colourClear, colourConsole, colourDebug, colourError, colourExec, colourWarn if not cmdline: @@ -148,36 +158,34 @@ def parse(): colourConsole = '\033[03;32m' colourDebug = '\033[03;34m' colourError = '\033[01;31m' - colourExec = '\033[03;36m' + colourExec = '\033[03;36m' #pylint: disable=unused-variable colourWarn = '\033[00;31m' if args.nocleanup: - _cleanup = False + cleanup = False if args.nthreads: - _nthreads = args.nthreads + numThreads = args.nthreads #pylint: disable=unused-variable if args.quiet: - _verbosity = 0 + verbosity = 0 elif args.info: - _verbosity = 2 + verbosity = 2 elif args.debug: - _verbosity = 3 + verbosity = 3 cmdline.printCitationWarning() if args.cont: - _tempDir = os.path.abspath(args.cont[0]) - _lastFile = args.cont[1] + tempDir = os.path.abspath(args.cont[0]) + lastFile = args.cont[1] #pylint: disable=unused-variable -#pylint: disable=unused-variable -def checkOutputPath(path): +def checkOutputPath(path): #pylint: disable=unused-variable import os - global args, force - global _workingDir + global args, forceOverwrite, workingDir if not path: return - abspath = os.path.abspath(os.path.join(_workingDir, path)) + abspath = os.path.abspath(os.path.join(workingDir, path)) if os.path.exists(abspath): output_type = '' if os.path.isfile(abspath): @@ -186,21 +194,20 @@ def checkOutputPath(path): output_type = ' directory' if args.force: warn('Output' + output_type + ' \'' + path + '\' already exists; will be overwritten at script completion') - force = True + forceOverwrite = True #pylint: disable=unused-variable else: error('Output' + output_type + ' \'' + path + '\' already exists (use -force to override)') -#pylint: disable=unused-variable -def makeTempDir(): +def makeTempDir(): #pylint: disable=unused-variable import os, random, string, sys global args, config - global _tempDir, _workingDir + global tempDir, workingDir if args.cont: debug('Skipping temporary directory creation due to use of -continue option') return - if _tempDir: + if tempDir: error('Script error: Cannot use multiple temporary directories') if args.tempdir: dir_path = os.path.abspath(args.tempdir) @@ -209,83 +216,71 @@ def makeTempDir(): dir_path = config['ScriptTmpDir'] else: # Defaulting to working directory since too many users have encountered storage issues - dir_path = _workingDir + dir_path = workingDir if 'ScriptTmpPrefix' in config: prefix = config['ScriptTmpPrefix'] else: prefix = os.path.basename(sys.argv[0]) + '-tmp-' - _tempDir = dir_path - while os.path.isdir(_tempDir): + tempDir = dir_path + while os.path.isdir(tempDir): random_string = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(6)) - _tempDir = os.path.join(dir_path, prefix + random_string) + os.sep - os.makedirs(_tempDir) - console('Generated temporary directory: ' + _tempDir) - with open(os.path.join(_tempDir, 'cwd.txt'), 'w') as outfile: - outfile.write(_workingDir + '\n') - with open(os.path.join(_tempDir, 'command.txt'), 'w') as outfile: + tempDir = os.path.join(dir_path, prefix + random_string) + os.sep + os.makedirs(tempDir) + console('Generated temporary directory: ' + tempDir) + with open(os.path.join(tempDir, 'cwd.txt'), 'w') as outfile: + outfile.write(workingDir + '\n') + with open(os.path.join(tempDir, 'command.txt'), 'w') as outfile: outfile.write(' '.join(sys.argv) + '\n') - open(os.path.join(_tempDir, 'log.txt'), 'w').close() + open(os.path.join(tempDir, 'log.txt'), 'w').close() -#pylint: disable=unused-variable -def gotoTempDir(): +def gotoTempDir(): #pylint: disable=unused-variable import os - global _tempDir - if not _tempDir: + global tempDir + if not tempDir: error('Script error: No temporary directory location set') - if _verbosity: - console('Changing to temporary directory (' + _tempDir + ')') - os.chdir(_tempDir) + if verbosity: + console('Changing to temporary directory (' + tempDir + ')') + os.chdir(tempDir) -#pylint: disable=unused-variable -def complete(): +def complete(): #pylint: disable=unused-variable import os, shutil, sys - global _cleanup, _tempDir, _workingDir + global cleanup, tempDir, workingDir global colourClear, colourConsole, colourWarn - console('Changing back to original directory (' + _workingDir + ')') - os.chdir(_workingDir) - if _cleanup and _tempDir: - console('Deleting temporary directory ' + _tempDir) - shutil.rmtree(_tempDir) - elif _tempDir: + console('Changing back to original directory (' + workingDir + ')') + os.chdir(workingDir) + if cleanup and tempDir: + console('Deleting temporary directory ' + tempDir) + shutil.rmtree(tempDir) + elif tempDir: # This needs to be printed even if the -quiet option is used - if os.path.isfile(os.path.join(_tempDir, 'error.txt')): - with open(os.path.join(_tempDir, 'error.txt'), 'r') as errortext: + if os.path.isfile(os.path.join(tempDir, 'error.txt')): + with open(os.path.join(tempDir, 'error.txt'), 'r') as errortext: sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + colourWarn + 'Script failed while executing the command: ' + errortext.readline().rstrip() + colourClear + '\n') - sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + colourWarn + 'For debugging, inspect contents of temporary directory: ' + _tempDir + colourClear + '\n') + sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + colourWarn + 'For debugging, inspect contents of temporary directory: ' + tempDir + colourClear + '\n') else: - sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + colourConsole + 'Contents of temporary directory kept, location: ' + _tempDir + colourClear + '\n') + sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + colourConsole + 'Contents of temporary directory kept, location: ' + tempDir + colourClear + '\n') sys.stderr.flush() # A set of functions and variables for printing various information at the command-line. -clearLine = '' -colourClear = '' -colourConsole = '' -colourDebug = '' -colourError = '' -colourExec = '' -colourWarn = '' - -#pylint: disable=unused-variable -def console(text): +def console(text): #pylint: disable=unused-variable import os, sys global colourClear, colourConsole - global _verbosity - if _verbosity: + global verbosity + if verbosity: sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + colourConsole + text + colourClear + '\n') -#pylint: disable=unused-variable -def debug(text): +def debug(text): #pylint: disable=unused-variable import inspect, os, sys global colourClear, colourDebug - global _verbosity - if _verbosity <= 2: + global verbosity + if verbosity <= 2: return if len(inspect.stack()) == 2: # debug() called directly from script being executed caller = inspect.getframeinfo(inspect.stack()[1][0]) @@ -306,18 +301,16 @@ def debug(text): origin = funcname + ' (from ' + os.path.basename(caller.filename) + ':' + str(caller.lineno) + ')' sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + colourDebug + '[DEBUG] ' + origin + ': ' + text + colourClear + '\n') -#pylint: disable=unused-variable -def error(text): +def error(text): #pylint: disable=unused-variable import os, sys global colourClear, colourError - global _cleanup + global cleanup sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + colourError + '[ERROR] ' + text + colourClear + '\n') - _cleanup = False + cleanup = False complete() sys.exit(1) -#pylint: disable=unused-variable -def warn(text): +def warn(text): #pylint: disable=unused-variable import os, sys global colourClear, colourWarn sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + colourWarn + '[WARNING] ' + text + colourClear + '\n') @@ -337,6 +330,8 @@ def warn(text): import argparse class Parser(argparse.ArgumentParser): + #pylint: disable=protected-access + def __init__(self, *args_in, **kwargs_in): global _defaultCopyright if 'author' in kwargs_in: @@ -344,14 +339,14 @@ def __init__(self, *args_in, **kwargs_in): del kwargs_in['author'] else: self._author = None - self._citationList = [ ] + self.citationList = [ ] if 'copyright' in kwargs_in: self._copyright = kwargs_in['copyright'] del kwargs_in['copyright'] else: self._copyright = _defaultCopyright self._description = [ ] - self._externalCitations = False + self.externalCitations = False if 'synopsis' in kwargs_in: self.synopsis = kwargs_in['synopsis'] del kwargs_in['synopsis'] @@ -362,8 +357,8 @@ def __init__(self, *args_in, **kwargs_in): self.mutuallyExclusiveOptionGroups = [ ] if 'parents' in kwargs_in: for parent in kwargs_in['parents']: - self._citationList.extend(parent._citationList) - self._externalCitations = self._externalCitations or parent._externalCitations + self.citationList.extend(parent.citationList) + self.externalCitations = self.externalCitations or parent.externalCitations else: standard_options = self.add_argument_group('Standard options') standard_options.add_argument('-continue', nargs=2, dest='cont', metavar=('', ''), help='Continue the script from a previous execution; must provide the temporary directory path, and the name of the last successfully-generated file') @@ -377,23 +372,19 @@ def __init__(self, *args_in, **kwargs_in): standard_options.add_argument('-debug', action='store_true', help='Display additional debugging information over and above the output of -info') self.flagMutuallyExclusiveOptions( [ 'quiet', 'info', 'debug' ] ) - #pylint: disable=unused-variable - def addCitation(self, condition, reference, is_external): - self._citationList.append( (condition, reference) ) + def addCitation(self, condition, reference, is_external): #pylint: disable=unused-variable + self.citationList.append( (condition, reference) ) if is_external: - self._externalCitations = True + self.externalCitations = True - #pylint: disable=unused-variable - def addDescription(self, text): + def addDescription(self, text): #pylint: disable=unused-variable self._description.append(text) - #pylint: disable=unused-variable - def setCopyright(self, text): + def setCopyright(self, text): #pylint: disable=unused-variable self._copyright = text # Mutually exclusive options need to be added before the command-line input is parsed - #pylint: disable=unused-variable - def flagMutuallyExclusiveOptions(self, options, required=False): + def flagMutuallyExclusiveOptions(self, options, required=False): #pylint: disable=unused-variable import sys if not isinstance(options, list) or not isinstance(options[0], str): sys.stderr.write('Script error: Parser.flagMutuallyExclusiveOptions() only accepts a list of strings\n') @@ -403,10 +394,10 @@ def flagMutuallyExclusiveOptions(self, options, required=False): def parse_args(self): result = argparse.ArgumentParser.parse_args(self) - self._checkMutuallyExclusiveOptions(result) + self.checkMutuallyExclusiveOptions(result) if self._subparsers: for alg in self._subparsers._group_actions[0].choices: - self._subparsers._group_actions[0].choices[alg]._checkMutuallyExclusiveOptions(result) + self._subparsers._group_actions[0].choices[alg].checkMutuallyExclusiveOptions(result) return result def printCitationWarning(self): @@ -419,10 +410,10 @@ def printCitationWarning(self): if alg == subparser: self._subparsers._group_actions[0].choices[alg].printCitationWarning() return - if self._citationList: + if self.citationList: console('') citation_warning = 'Note that this script makes use of commands / algorithms that have relevant articles for citation' - if self._externalCitations: + if self.externalCitations: citation_warning += '; INCLUDING FROM EXTERNAL SOFTWARE PACKAGES' citation_warning += '. Please consult the help page (-help option) for more information.' console(citation_warning) @@ -438,11 +429,11 @@ def error(self, text): if self.prog and len(shlex.split(self.prog)) == len(sys.argv): # No arguments provided to subparser self.printHelp() sys.exit(0) - usage = self._formatUsage() + usage = self.formatUsage() if self._subparsers: for alg in self._subparsers._group_actions[0].choices: if alg == sys.argv[1]: - usage = self._subparsers._group_actions[0].choices[alg]._formatUsage() + usage = self._subparsers._group_actions[0].choices[alg].formatUsage() continue sys.stderr.write('\nError: %s\n' % text) sys.stderr.write('Usage: ' + usage + '\n') @@ -450,7 +441,7 @@ def error(self, text): sys.stderr.flush() sys.exit(1) - def _checkMutuallyExclusiveOptions(self, args_in): + def checkMutuallyExclusiveOptions(self, args_in): import sys for group in self.mutuallyExclusiveOptionGroups: count = 0 @@ -475,7 +466,7 @@ def _checkMutuallyExclusiveOptions(self, args_in): sys.stderr.flush() sys.exit(1) - def _formatUsage(self): + def formatUsage(self): argument_list = [ ] trailing_ellipsis = '' if self._subparsers: @@ -588,11 +579,11 @@ def appVersion(): s += '\n' s += bold('COPYRIGHT') + '\n' s += w.fill(self._copyright) + '\n' - if self._citationList: + if self.citationList: s += '\n' s += bold('REFERENCES') + '\n' s += '\n' - for entry in self._citationList: + for entry in self.citationList: if entry[0]: s += w.fill('* ' + entry[0] + ':') + '\n' s += w.fill(entry[1]) + '\n' @@ -622,7 +613,7 @@ def printFullUsage(self): if self._subparsers and len(sys.argv) == 3: for alg in self._subparsers._group_actions[0].choices: if alg == sys.argv[1]: - self._subparsers._group_actions[0].choices[alg]._printFullUsage() + self._subparsers._group_actions[0].choices[alg].printFullUsage() return self.error('Invalid subparser nominated') for arg in self._positionals._group_actions: @@ -646,7 +637,7 @@ def printUsageMarkdown(self): if self._subparsers and len(sys.argv) == 3: for alg in self._subparsers._group_actions[0].choices: if alg == sys.argv[-2]: - self._subparsers._group_actions[0].choices[alg]._printUsageMarkdown() + self._subparsers._group_actions[0].choices[alg].printUsageMarkdown() return self.error('Invalid subcmdline nominated') print ('## Synopsis') @@ -655,7 +646,7 @@ def printUsageMarkdown(self): print ('') print ('## Usage') print ('') - print (' ' + self._formatUsage()) + print (' ' + self.formatUsage()) print ('') if self._subparsers: print ('- *' + self._subparsers._group_actions[0].dest + '*: ' + self._subparsers._group_actions[0].help) @@ -688,10 +679,10 @@ def printUsageMarkdown(self): text += option.metavar print ('+ **-' + text + '**
' + option.help) print ('') - if self._citationList: + if self.citationList: print ('## References') print ('') - for ref in self._citationList: + for ref in self.citationList: text = '' if ref[0]: text += ref[0] + ': ' @@ -714,7 +705,7 @@ def printUsageRst(self): if self._subparsers and len(sys.argv) == 3: for alg in self._subparsers._group_actions[0].choices: if alg == sys.argv[-2]: - self._subparsers._group_actions[0].choices[alg]._printUsageRst() + self._subparsers._group_actions[0].choices[alg].printUsageRst() return self.error('Invalid subparser nominated: ' + sys.argv[-2]) print ('.. _' + self.prog.replace(' ', '_') + ':') @@ -732,7 +723,7 @@ def printUsageRst(self): print ('') print ('::') print ('') - print (' ' + self._formatUsage()) + print (' ' + self.formatUsage()) print ('') if self._subparsers: print ('- *' + self._subparsers._group_actions[0].dest + '*: ' + self._subparsers._group_actions[0].help) @@ -767,11 +758,11 @@ def printUsageRst(self): text += option.metavar print ('') print ('- **' + text + '** ' + option.help.replace('|', '\\|')) - if self._citationList: + if self.citationList: print ('') print ('References') print ('^^^^^^^^^^') - for ref in self._citationList: + for ref in self.citationList: text = '* ' if ref[0]: text += ref[0] + ': ' @@ -796,7 +787,7 @@ def printUsageRst(self): # A class that can be used to display a progress bar on the terminal, # mimicing the behaviour of MRtrix3 binary commands -class progressBar: +class progressBar: #pylint: disable=unused-variable def _update(self): import os, sys @@ -805,13 +796,13 @@ def _update(self): sys.stderr.flush() def __init__(self, msg, target): - global _verbosity + global verbosity self.counter = 0 self.message = msg - self.newline = '\n' if _verbosity > 1 else '' # If any more than default verbosity, may still get details printed in between progress updates - self.orig_verbosity = _verbosity + self.newline = '\n' if verbosity > 1 else '' # If any more than default verbosity, may still get details printed in between progress updates + self.origverbosity = verbosity self.target = target - _verbosity = _verbosity - 1 if _verbosity else 0 + verbosity = verbosity - 1 if verbosity else 0 self._update() def increment(self, msg=''): @@ -822,19 +813,18 @@ def increment(self, msg=''): def done(self): import os, sys - global _verbosity + global verbosity global clearLine, colourConsole, colourClear self.counter = self.target sys.stderr.write('\r' + colourConsole + os.path.basename(sys.argv[0]) + ': ' + colourClear + '[100%] ' + self.message + clearLine + '\n') sys.stderr.flush() - _verbosity = self.orig_verbosity + verbosity = self.origverbosity # Return a boolean flag to indicate whether or not script is being run on a Windows machine -#pylint: disable=unused-variable -def isWindows(): +def isWindows(): #pylint: disable=unused-variable import platform system = platform.system().lower() return system.startswith('mingw') or system.startswith('msys') or system.startswith('windows') @@ -843,7 +833,7 @@ def isWindows(): # Handler function for dealing with system signals -def _handler(signum, _frame): +def handler(signum, _frame): import os, signal, sys global _signals # First, kill any child processes diff --git a/lib/mrtrix3/dwi2response/dhollander.py b/lib/mrtrix3/dwi2response/dhollander.py index 0e006881aa..eca0fa73ea 100644 --- a/lib/mrtrix3/dwi2response/dhollander.py +++ b/lib/mrtrix3/dwi2response/dhollander.py @@ -1,5 +1,4 @@ -#pylint: disable=unused-variable -def initialise(base_parser, subparsers): +def initialise(base_parser, subparsers): #pylint: disable=unused-variable parser = subparsers.add_parser('dhollander', author='Thijs Dhollander (thijs.dhollander@gmail.com)', synopsis='Unsupervised estimation of WM, GM and CSF response functions; does not require a T1 image (or segmentation thereof)', parents=[base_parser]) parser.addCitation('', 'Dhollander, T.; Raffelt, D. & Connelly, A. Unsupervised 3-tissue response function estimation from single-shell or multi-shell diffusion MR data without a co-registered T1 image. ISMRM Workshop on Breaking the Barriers of Diffusion MRI, 2016, 5', False) parser.add_argument('input', help='The input DWI') @@ -15,8 +14,7 @@ def initialise(base_parser, subparsers): -#pylint: disable=unused-variable -def checkOutputPaths(): +def checkOutputPaths(): #pylint: disable=unused-variable from mrtrix3 import app app.checkOutputPath(app.args.out_sfwm) app.checkOutputPath(app.args.out_gm) @@ -24,20 +22,17 @@ def checkOutputPaths(): -#pylint: disable=unused-variable -def getInputs(): +def getInputs(): #pylint: disable=unused-variable pass -#pylint: disable=unused-variable -def needsSingleShell(): +def needsSingleShell(): #pylint: disable=unused-variable return False -#pylint: disable=unused-variable -def execute(): +def execute(): #pylint: disable=unused-variable import shutil from mrtrix3 import app, image, path, run @@ -137,9 +132,9 @@ def execute(): voxsfwmcount = int(round(refwmcount * app.args.sfwm / 100.0)) app.console('Running \'tournier\' algorithm to select ' + str(voxsfwmcount) + ' single-fibre WM voxels.') cleanopt = '' - if not app._cleanup: + if not app.cleanup: cleanopt = ' -nocleanup' - run.command('dwi2response tournier dwi.mif _respsfwmss.txt -sf_voxels ' + str(voxsfwmcount) + ' -iter_voxels ' + str(voxsfwmcount * 10) + ' -mask refined_wm.mif -voxels voxels_sfwm.mif -tempdir ' + app._tempDir + cleanopt) + run.command('dwi2response tournier dwi.mif _respsfwmss.txt -sf_voxels ' + str(voxsfwmcount) + ' -iter_voxels ' + str(voxsfwmcount * 10) + ' -mask refined_wm.mif -voxels voxels_sfwm.mif -tempdir ' + app.tempDir + cleanopt) # Get final voxels for GM response function estimation from GM. refgmmedian = image.statistic('safe_sdm.mif', 'median', 'refined_gm.mif') diff --git a/lib/mrtrix3/dwi2response/fa.py b/lib/mrtrix3/dwi2response/fa.py index eb7b433703..e7695a0acf 100644 --- a/lib/mrtrix3/dwi2response/fa.py +++ b/lib/mrtrix3/dwi2response/fa.py @@ -1,5 +1,4 @@ -#pylint: disable=unused-variable -def initialise(base_parser, subparsers): +def initialise(base_parser, subparsers): #pylint: disable=unused-variable parser = subparsers.add_parser('fa', author='Robert E. Smith (robert.smith@florey.edu.au)', synopsis='Use the old FA-threshold heuristic for single-fibre voxel selection and response function estimation', parents=[base_parser]) parser.addCitation('', 'Tournier, J.-D.; Calamante, F.; Gadian, D. G. & Connelly, A. Direct estimation of the fiber orientation density function from diffusion-weighted MRI data using spherical deconvolution. NeuroImage, 2004, 23, 1176-1185', False) parser.add_argument('input', help='The input DWI') @@ -12,27 +11,23 @@ def initialise(base_parser, subparsers): -#pylint: disable=unused-variable -def checkOutputPaths(): +def checkOutputPaths(): #pylint: disable=unused-variable from mrtrix3 import app app.checkOutputPath(app.args.output) -#pylint: disable=unused-variable -def getInputs(): +def getInputs(): #pylint: disable=unused-variable pass -#pylint: disable=unused-variable -def needsSingleShell(): +def needsSingleShell(): #pylint: disable=unused-variable return False -#pylint: disable=unused-variable -def execute(): +def execute(): #pylint: disable=unused-variable import shutil from mrtrix3 import app, image, path, run bvalues = [ int(round(float(x))) for x in image.mrinfo('dwi.mif', 'shells').split() ] diff --git a/lib/mrtrix3/dwi2response/manual.py b/lib/mrtrix3/dwi2response/manual.py index e1f96f32ba..c6cc0685f7 100644 --- a/lib/mrtrix3/dwi2response/manual.py +++ b/lib/mrtrix3/dwi2response/manual.py @@ -1,5 +1,4 @@ -#pylint: disable=unused-variable -def initialise(base_parser, subparsers): +def initialise(base_parser, subparsers): #pylint: disable=unused-variable parser = subparsers.add_parser('manual', author='Robert E. Smith (robert.smith@florey.edu.au)', synopsis='Derive a response function using an input mask image alone (i.e. pre-selected voxels)', parents=[base_parser]) parser.add_argument('input', help='The input DWI') parser.add_argument('in_voxels', help='Input voxel selection mask') @@ -9,15 +8,13 @@ def initialise(base_parser, subparsers): -#pylint: disable=unused-variable -def checkOutputPaths(): +def checkOutputPaths(): #pylint: disable=unused-variable from mrtrix3 import app app.checkOutputPath(app.args.output) -#pylint: disable=unused-variable -def getInputs(): +def getInputs(): #pylint: disable=unused-variable import os from mrtrix3 import app, path, run mask_path = path.toTemp('mask.mif', False) @@ -30,14 +27,12 @@ def getInputs(): -#pylint: disable=unused-variable -def needsSingleShell(): +def needsSingleShell(): #pylint: disable=unused-variable return False -#pylint: disable=unused-variable -def execute(): +def execute(): #pylint: disable=unused-variable import os, shutil from mrtrix3 import app, image, path, run diff --git a/lib/mrtrix3/dwi2response/msmt_5tt.py b/lib/mrtrix3/dwi2response/msmt_5tt.py index ed69d49166..adafee5c80 100644 --- a/lib/mrtrix3/dwi2response/msmt_5tt.py +++ b/lib/mrtrix3/dwi2response/msmt_5tt.py @@ -1,5 +1,4 @@ -#pylint: disable=unused-variable -def initialise(base_parser, subparsers): +def initialise(base_parser, subparsers): #pylint: disable=unused-variable parser = subparsers.add_parser('msmt_5tt', author='Robert E. Smith (robert.smith@florey.edu.au)', synopsis='Derive MSMT-CSD tissue response functions based on a co-registered five-tissue-type (5TT) image', parents=[base_parser]) parser.addCitation('', 'Jeurissen, B.; Tournier, J.-D.; Dhollander, T.; Connelly, A. & Sijbers, J. Multi-tissue constrained spherical deconvolution for improved analysis of multi-shell diffusion MRI data. NeuroImage, 2014, 103, 411-426', False) parser.add_argument('input', help='The input DWI') @@ -15,8 +14,7 @@ def initialise(base_parser, subparsers): -#pylint: disable=unused-variable -def checkOutputPaths(): +def checkOutputPaths(): #pylint: disable=unused-variable from mrtrix3 import app app.checkOutputPath(app.args.out_wm) app.checkOutputPath(app.args.out_gm) @@ -24,8 +22,7 @@ def checkOutputPaths(): -#pylint: disable=unused-variable -def getInputs(): +def getInputs(): #pylint: disable=unused-variable from mrtrix3 import app, path, run run.command('mrconvert ' + path.fromUser(app.args.in_5tt, True) + ' ' + path.toTemp('5tt.mif', True)) if app.args.dirs: @@ -33,14 +30,12 @@ def getInputs(): -#pylint: disable=unused-variable -def needsSingleShell(): +def needsSingleShell(): #pylint: disable=unused-variable return False -#pylint: disable=unused-variable -def execute(): +def execute(): #pylint: disable=unused-variable import os, shutil from mrtrix3 import app, image, path, run @@ -80,9 +75,9 @@ def execute(): # Revise WM mask to only include single-fibre voxels app.console('Calling dwi2response recursively to select WM single-fibre voxels using \'' + app.args.wm_algo + '\' algorithm') recursive_cleanup_option='' - if not app._cleanup: + if not app.cleanup: recursive_cleanup_option = ' -nocleanup' - run.command('dwi2response ' + app.args.wm_algo + ' dwi.mif wm_ss_response.txt -mask wm_mask.mif -voxels wm_sf_mask.mif -tempdir ' + app._tempDir + recursive_cleanup_option) + run.command('dwi2response ' + app.args.wm_algo + ' dwi.mif wm_ss_response.txt -mask wm_mask.mif -voxels wm_sf_mask.mif -tempdir ' + app.tempDir + recursive_cleanup_option) # Check for empty masks wm_voxels = int(image.statistic('wm_sf_mask.mif', 'count', 'wm_sf_mask.mif')) diff --git a/lib/mrtrix3/dwi2response/tax.py b/lib/mrtrix3/dwi2response/tax.py index 1f66e15139..b85b699e9e 100644 --- a/lib/mrtrix3/dwi2response/tax.py +++ b/lib/mrtrix3/dwi2response/tax.py @@ -1,5 +1,4 @@ -#pylint: disable=unused-variable -def initialise(base_parser, subparsers): +def initialise(base_parser, subparsers): #pylint: disable=unused-variable parser = subparsers.add_parser('tax', author='Robert E. Smith (robert.smith@florey.edu.au)', synopsis='Use the Tax et al. (2014) recursive calibration algorithm for single-fibre voxel selection and response function estimation', parents=[base_parser]) parser.addCitation('', 'Tax, C. M.; Jeurissen, B.; Vos, S. B.; Viergever, M. A. & Leemans, A. Recursive calibration of the fiber response function for spherical deconvolution of diffusion MRI data. NeuroImage, 2014, 86, 67-80', False) parser.add_argument('input', help='The input DWI') @@ -11,27 +10,23 @@ def initialise(base_parser, subparsers): -#pylint: disable=unused-variable -def checkOutputPaths(): +def checkOutputPaths(): #pylint: disable=unused-variable from mrtrix3 import app app.checkOutputPath(app.args.output) -#pylint: disable=unused-variable -def getInputs(): +def getInputs(): #pylint: disable=unused-variable pass -#pylint: disable=unused-variable -def needsSingleShell(): +def needsSingleShell(): #pylint: disable=unused-variable return True -#pylint: disable=unused-variable -def execute(): +def execute(): #pylint: disable=unused-variable import math, os, shutil from mrtrix3 import app, file, image, path, run diff --git a/lib/mrtrix3/dwi2response/tournier.py b/lib/mrtrix3/dwi2response/tournier.py index 590a389791..39d15c9d47 100644 --- a/lib/mrtrix3/dwi2response/tournier.py +++ b/lib/mrtrix3/dwi2response/tournier.py @@ -1,5 +1,4 @@ -#pylint: disable=unused-variable -def initialise(base_parser, subparsers): +def initialise(base_parser, subparsers): #pylint: disable=unused-variable parser = subparsers.add_parser('tournier', author='Robert E. Smith (robert.smith@florey.edu.au)', synopsis='Use the Tournier et al. (2013) iterative algorithm for single-fibre voxel selection and response function estimation', parents=[base_parser]) parser.addCitation('', 'Tournier, J.-D.; Calamante, F. & Connelly, A. Determination of the appropriate b-value and number of gradient directions for high-angular-resolution diffusion-weighted imaging. NMR Biomedicine, 2013, 26, 1775-1786', False) parser.add_argument('input', help='The input DWI') @@ -12,27 +11,23 @@ def initialise(base_parser, subparsers): -#pylint: disable=unused-variable -def checkOutputPaths(): +def checkOutputPaths(): #pylint: disable=unused-variable from mrtrix3 import app app.checkOutputPath(app.args.output) -#pylint: disable=unused-variable -def getInputs(): +def getInputs(): #pylint: disable=unused-variable pass -#pylint: disable=unused-variable -def needsSingleShell(): +def needsSingleShell(): #pylint: disable=unused-variable return True -#pylint: disable=unused-variable -def execute(): +def execute(): #pylint: disable=unused-variable import os, shutil from mrtrix3 import app, file, image, path, run diff --git a/lib/mrtrix3/file.py b/lib/mrtrix3/file.py index 7a634aa00a..9330e91a83 100644 --- a/lib/mrtrix3/file.py +++ b/lib/mrtrix3/file.py @@ -6,11 +6,10 @@ # that is no longer required by the script. If the script has been instructed to retain # all temporaries, the resource will be retained; if not, it will be deleted (in particular # to dynamically free up storage space used by the script). -#pylint: disable=unused-variable -def delTemporary(path): +def delTemporary(path): #pylint: disable=unused-variable import shutil, os from mrtrix3 import app - if not app._cleanup: + if not app.cleanup: return if os.path.isfile(path): temporary_type = 'file' @@ -21,7 +20,7 @@ def delTemporary(path): else: app.debug('Unknown target \'' + path + '\'') return - if app._verbosity > 2: + if app.verbosity > 2: app.console('Deleting temporary ' + temporary_type + ': \'' + path + '\'') try: func(path) @@ -31,8 +30,7 @@ def delTemporary(path): # Make a directory if it doesn't exist; don't do anything if it does already exist -#pylint: disable=unused-variable -def makeDir(path): +def makeDir(path): #pylint: disable=unused-variable import errno, os from mrtrix3 import app try: @@ -47,14 +45,13 @@ def makeDir(path): # Get an appropriate location and name for a new temporary file # Note: Doesn't actually create a file; just gives a unique name that won't over-write anything -#pylint: disable=unused-variable -def newTempFile(suffix): - import os, random, string, sys +def newTempFile(suffix): #pylint: disable=unused-variable + import os.path, random, string from mrtrix3 import app if 'TmpFileDir' in app.config: dir_path = app.config['TmpFileDir'] - elif app._tempDir: - dir_path = app._tempDir + elif app.tempDir: + dir_path = app.tempDir else: dir_path = os.getcwd() app.debug(dir_path) @@ -90,8 +87,7 @@ def newTempFile(suffix): # Initially, checks for the file once every 1/1000th of a second; this gradually # increases if the file still doesn't exist, until the program is only checking # for the file once a minute. -#pylint: disable=unused-variable -def waitFor(path): +def waitFor(path): #pylint: disable=unused-variable import os, time from mrtrix3 import app diff --git a/lib/mrtrix3/fsl.py b/lib/mrtrix3/fsl.py index 7e5e0beec9..86bf541ef0 100644 --- a/lib/mrtrix3/fsl.py +++ b/lib/mrtrix3/fsl.py @@ -6,8 +6,7 @@ # this depends on both whether or not the user has requested that the CUDA # version of eddy be used, and the various names that this command could # conceivably be installed as. -#pylint: disable=unused-variable -def eddyBinary(cuda): +def eddyBinary(cuda): #pylint: disable=unused-variable import os from mrtrix3 import app from distutils.spawn import find_executable @@ -54,8 +53,7 @@ def eddyBinary(cuda): # makes it more convenient to locate these commands. # Note that if FSL 4 and 5 are installed side-by-side, the approach taken in this # function will select the version 5 executable. -#pylint: disable=unused-variable -def exeName(name): +def exeName(name): #pylint: disable=unused-variable from mrtrix3 import app from distutils.spawn import find_executable if find_executable('fsl5.0-' + name): @@ -73,8 +71,7 @@ def exeName(name): # FSL commands will generate based on the suffix() function, the FSL binaries themselves # ignore the FSLOUTPUTTYPE environment variable. Therefore, the safest approach is: # Whenever receiving an output image from an FSL command, explicitly search for the path -#pylint: disable=unused-variable -def findImage(name): +def findImage(name): #pylint: disable=unused-variable import os from mrtrix3 import app basename = name.split('.')[0] @@ -93,8 +90,7 @@ def findImage(name): # stored in 'FSLOUTPUTTYPE'. This may even override a filename extension provided # to the relevant command. Therefore use this function to 'guess' what the names # of images provided by FSL commands will be. -#pylint: disable=unused-variable -def suffix(): +def suffix(): #pylint: disable=unused-variable import os from mrtrix3 import app global _suffix diff --git a/lib/mrtrix3/image.py b/lib/mrtrix3/image.py index bd17f85c4e..eaab1e3636 100644 --- a/lib/mrtrix3/image.py +++ b/lib/mrtrix3/image.py @@ -3,51 +3,59 @@ # data, rather than trying to duplicate support for all possible image formats natively # in Python. -#pylint: disable=unused-variable -def check3DNonunity(image_path): +def check3DNonunity(image_in): #pylint: disable=unused-variable from mrtrix3 import app - dim = header(image_path).size - if len(dim) < 3: - app.error('Image \'' + image_path + '\' does not contain 3 spatial dimensions') - if min(dim[:3]) == 1: - app.error('Image \'' + image_path + '\' does not contain 3D spatial information (axis with size 1)') + if not isHeader(image_in): + if not isinstance(image_in, str): + app.error('Error trying to test \'' + str(image_in) + '\': Not an image header or file path') + image_in = header(image_in) + if len(image_in.size) < 3: + app.error('Image \'' + image_in.name + '\' does not contain 3 spatial dimensions') + if min(image_in.size[:3]) == 1: + app.error('Image \'' + image_in.name + '\' does not contain 3D spatial information (has axis with size 1)') + app.debug('Image \'' + image_in.name + '\' is >= 3D, and does not contain a unity spatial dimension') # Function to grab all contents of an image header # Uses mrinfo's new -json_all option in order to grab all header information # from any image format supported by MRtrix3's C++ libraries -class _Header: - def __init__(self, image_path): - import json, os, subprocess, tempfile - from mrtrix3 import app, path, run - filename = path.newTemporary('json') - command = [ run.exeName(run.versionMatch('mrinfo')), image_path, '-json_all', filename ] - if app._verbosity > 1: - app.console('Loading header for image file \'' + image_path + '\'') - app.debug(str(command)) - result = subprocess.call(command, stdout=None, stderr=None) - if result: - app.error('Could not access header information for image \'' + image_path + '\'') - with open(filename, 'r') as f: - elements = json.load(f) - os.remove(filename) - self.name = self.format = self.datatype = '' - self.size = self.spacing = self.stride = [] - self.intensity_offset = 0.0 - self.intensity_scale = 1.0 - self.transform = [[]] - self.keyval = { } - self.__dict__.update(elements) - #pylint: disable-msg=too-many-boolean-expressions - if not self.name or not self.size or not self.spacing or not self.stride or not \ - self.format or not self.datatype or not self.transform: - app.error('Error in reading header information from file \'' + image_path + '\'') - -#pylint: disable=unused-variable def header(image_path): - result = _Header(image_path) - return result + import json, os, subprocess + from mrtrix3 import app, path, run + filename = path.newTemporary('json') + command = [ run.exeName(run.versionMatch('mrinfo')), image_path, '-json_all', filename ] + if app.verbosity > 1: + app.console('Loading header for image file \'' + image_path + '\'') + app.debug(str(command)) + result = subprocess.call(command, stdout=None, stderr=None) + if result: + app.error('Could not access header information for image \'' + image_path + '\'') + with open(filename, 'r') as f: + elements = json.load(f) + if not hasattr(elements, 'keyval') or not elements.keyval: + elements.keyval = {} + os.remove(filename) + if not isHeader(elements): + app.error('Error in reading header information from file \'' + image_path + '\'') + app.debug(vars(elements)) + return elements + + + +# Function to test whether or not a Python object contains those flags expected +# within an image header +def isHeader(obj): + from mrtrix3 import app + try: + #pylint: disable=pointless-statement,too-many-boolean-expressions + obj.name and obj.size and obj.spacing and obj.stride and obj.format and obj.datatype \ + and obj.intensity_offset and obj.intensity_scale and obj.transform and obj.keyval + app.debug('\'' + str(obj) + '\' IS a header object') + return True + except: + app.debug('\'' + str(obj) + '\' is NOT a header object') + return False @@ -56,17 +64,16 @@ def header(image_path): # Therefore, provide this function to execute mrinfo and get just the information of # interest. Note however that parsing the output of mrinfo e.g. into list / numerical # form is not performed by this function. -#pylint: disable=unused-variable -def mrinfo(image_path, field): +def mrinfo(image_path, field): #pylint: disable=unused-variable import subprocess from mrtrix3 import app, run command = [ run.exeName(run.versionMatch('mrinfo')), image_path, '-' + field ] - if app._verbosity > 1: + if app.verbosity > 1: app.console('Command: \'' + ' '.join(command) + '\' (piping data to local storage)') proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=None) result, dummy_err = proc.communicate() result = result.rstrip().decode('utf-8') - if app._verbosity > 1: + if app.verbosity > 1: app.console('Result: ' + result) return result @@ -74,15 +81,14 @@ def mrinfo(image_path, field): # Check to see whether the fundamental header properties of two images match # Inputs can be either _Header class instances, or file paths -#pylint: disable=unused-variable -def match(image_one, image_two): +def match(image_one, image_two): #pylint: disable=unused-variable import math from mrtrix3 import app - if not isinstance(image_one, _Header): + if not isHeader(image_one): if not isinstance(image_one, str): app.error('Error trying to test \'' + str(image_one) + '\': Not an image header or file path') image_one = header(image_one) - if not isinstance(image_two, _Header): + if not isHeader(image_two): if not isinstance(image_two, str): app.error('Error trying to test \'' + str(image_two) + '\': Not an image header or file path') image_two = header(image_two) @@ -111,18 +117,17 @@ def match(image_one, image_two): # TODO Change mask_path to instead receive a string of additional command-line options # (that way, -allvolumes can be used) -#pylint: disable=unused-variable -def statistic(image_path, stat, mask_path = ''): +def statistic(image_path, stat, mask_path = ''): #pylint: disable=unused-variable import subprocess from mrtrix3 import app, run command = [ run.exeName(run.versionMatch('mrstats')), image_path, '-output', stat ] if mask_path: command.extend([ '-mask', mask_path ]) - if app._verbosity > 1: + if app.verbosity > 1: app.console('Command: \'' + ' '.join(command) + '\' (piping data to local storage)') proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=None) result, dummy_err = proc.communicate() result = result.rstrip().decode('utf-8') - if app._verbosity > 1: + if app.verbosity > 1: app.console('Result: ' + result) return result diff --git a/lib/mrtrix3/path.py b/lib/mrtrix3/path.py index 10b90e9a0d..1d2aff7501 100644 --- a/lib/mrtrix3/path.py +++ b/lib/mrtrix3/path.py @@ -1,8 +1,7 @@ # A collection of functions used to operate upon file and directory paths # Determines the common postfix for a list of filenames (including the file extension) -#pylint: disable=unused-variable -def commonPostfix(inputFiles): +def commonPostfix(inputFiles): #pylint: disable=unused-variable from mrtrix3 import app first = inputFiles[0] cursor = 0 @@ -29,14 +28,13 @@ def commonPostfix(inputFiles): # To add quotation marks where the output path is being interpreted as part of a full command string # (e.g. to be passed to run.command()); without these quotation marks, paths that include spaces would be # erroneously split, subsequently confusing whatever command is being invoked. -#pylint: disable=unused-variable -def fromUser(filename, is_command): +def fromUser(filename, is_command): #pylint: disable=unused-variable import os from mrtrix3 import app wrapper='' - if is_command and (filename.count(' ') or app._workingDir.count(' ')): + if is_command and (filename.count(' ') or app.workingDir.count(' ')): wrapper='\"' - path = wrapper + os.path.abspath(os.path.join(app._workingDir, filename)) + wrapper + path = wrapper + os.path.abspath(os.path.join(app.workingDir, filename)) + wrapper app.debug(filename + ' -> ' + path) return path @@ -44,14 +42,13 @@ def fromUser(filename, is_command): # Get an appropriate location and name for a new temporary file / directory # Note: Doesn't actually create anything; just gives a unique name that won't over-write anything -#pylint: disable=unused-variable -def newTemporary(suffix): - import os, random, string, sys +def newTemporary(suffix): #pylint: disable=unused-variable + import os.path, random, string from mrtrix3 import app if 'TmpFileDir' in app.config: dir_path = app.config['TmpFileDir'] - elif app._tempDir: - dir_path = app._tempDir + elif app.tempDir: + dir_path = app.tempDir else: dir_path = os.getcwd() if 'TmpFilePrefix' in app.config: @@ -70,8 +67,7 @@ def newTemporary(suffix): # Determine the name of a sub-directory containing additional data / source files for a script # This can be algorithm files in lib/mrtrix3, or data files in /share/mrtrix3/ -#pylint: disable=unused-variable -def scriptSubDirName(): +def scriptSubDirName(): #pylint: disable=unused-variable import inspect, os from mrtrix3 import app # TODO Test this on multiple Python versions, with & without softlinking @@ -87,8 +83,7 @@ def scriptSubDirName(): # Some scripts come with additional requisite data files; this function makes it easy to find them. # For data that is stored in a named sub-directory specifically for a particular script, this function will # need to be used in conjunction with scriptSubDirName() -#pylint: disable=unused-variable -def sharedDataPath(): +def sharedDataPath(): #pylint: disable=unused-variable import os from mrtrix3 import app result = os.path.realpath(os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir, os.pardir, 'share', 'mrtrix3'))) @@ -98,13 +93,12 @@ def sharedDataPath(): # Get the full absolute path to a location in the temporary script directory -#pylint: disable=unused-variable -def toTemp(filename, is_command): +def toTemp(filename, is_command): #pylint: disable=unused-variable import os from mrtrix3 import app wrapper='' if is_command and filename.count(' '): wrapper='\"' - path = wrapper + os.path.abspath(os.path.join(app._tempDir, filename)) + wrapper + path = wrapper + os.path.abspath(os.path.join(app.tempDir, filename)) + wrapper app.debug(filename + ' -> ' + path) return path diff --git a/lib/mrtrix3/phaseEncoding.py b/lib/mrtrix3/phaseEncoding.py index 7c54933881..52b67aa015 100644 --- a/lib/mrtrix3/phaseEncoding.py +++ b/lib/mrtrix3/phaseEncoding.py @@ -1,8 +1,7 @@ # Functions relating to handling phase encoding information # From a user-specified string, determine the axis and direction of phase encoding -#pylint: disable=unused-variable -def direction(string): +def direction(string): #pylint: disable=unused-variable from mrtrix3 import app pe_dir = '' try: @@ -50,10 +49,9 @@ def direction(string): # Extract a phase-encoding scheme from a pre-loaded image header, # or from a path to the image -#pylint: disable=unused-variable -def getScheme(arg): +def getScheme(arg): #pylint: disable=unused-variable from mrtrix3 import app, image - if not isinstance(arg, image._Header): + if not image.isHeader(arg): if not isinstance(arg, str): app.error('Error trying to derive phase-encoding scheme from \'' + str(arg) + '\': Not an image header or file path') arg = image.header(arg) diff --git a/lib/mrtrix3/run.py b/lib/mrtrix3/run.py index 236da1d999..621eab9999 100644 --- a/lib/mrtrix3/run.py +++ b/lib/mrtrix3/run.py @@ -7,8 +7,7 @@ -#pylint: disable=unused-variable -def command(cmd, exitOnError=True): +def command(cmd, exitOnError=True): #pylint: disable=unused-variable import inspect, itertools, shlex, signal, subprocess, sys, tempfile from distutils.spawn import find_executable @@ -19,7 +18,7 @@ def command(cmd, exitOnError=True): # Vectorise the command string, preserving anything encased within quotation marks cmdsplit = shlex.split(cmd) - if app._lastFile: + if app.lastFile: # Check to see if the last file produced in the previous script execution is # intended to be produced by this command; if it is, this will be the last # command that gets skipped by the -continue option @@ -30,12 +29,13 @@ def command(cmd, exitOnError=True): cmdtotest = entry.split('=')[1] else: cmdtotest = entry - filetotest = [ app._lastFile, os.path.splitext(app._lastFile)[0] ] + filetotest = [ app.lastFile, os.path.splitext(app.lastFile)[0] ] if cmdtotest in filetotest: - app.debug('Detected last file \'' + app._lastFile + '\' in command \'' + cmd + '\'; this is the last run.command() / run.function() call that will be skipped') - app._lastFile = '' + app.debug('Detected last file \'' + app.lastFile + '\' in command \'' + cmd + '\'; this is the last run.command() / run.function() call that will be skipped') + #pylint: disable=unused-variable + app.lastFile = '' break - if app._verbosity: + if app.verbosity: sys.stderr.write(app.colourExec + 'Skipping command:' + app.colourClear + ' ' + cmd + '\n') sys.stderr.flush() return @@ -50,12 +50,12 @@ def command(cmd, exitOnError=True): is_mrtrix_exe = line[0] in _mrtrix_exe_list if is_mrtrix_exe: line[0] = versionMatch(line[0]) - if app._nthreads is not None: - line.extend( [ '-nthreads', str(app._nthreads) ] ) + if app.numThreads is not None: + line.extend( [ '-nthreads', str(app.numThreads) ] ) # Get MRtrix3 binaries to output additional INFO-level information if running in debug mode - if app._verbosity == 3: + if app.verbosity == 3: line.append('-info') - elif not app._verbosity: + elif not app.verbosity: line.append('-quiet') else: line[0] = exeName(line[0]) @@ -69,7 +69,7 @@ def command(cmd, exitOnError=True): for item in reversed(shebang): line.insert(0, item) - if app._verbosity: + if app.verbosity: sys.stderr.write(app.colourExec + 'Command:' + app.colourClear + ' ' + cmd + '\n') sys.stderr.flush() @@ -101,7 +101,7 @@ def command(cmd, exitOnError=True): # If we're in debug / info mode, the contents of stderr will be read and printed to the terminal # as the command progresses, hence this needs to go to a pipe; otherwise, write it to a temporary # file so that the contents can be read later - if app._verbosity > 1: + if app.verbosity > 1: handle_err = subprocess.PIPE else: file_err = tempfile.TemporaryFile() @@ -122,7 +122,7 @@ def command(cmd, exitOnError=True): _processes = [ ] break except (KeyboardInterrupt, SystemExit): - app._handler(signal.SIGINT, inspect.currentframe()) + app.handler(signal.SIGINT, inspect.currentframe()) return_stdout = '' return_stderr = '' @@ -134,7 +134,7 @@ def command(cmd, exitOnError=True): # Switch how we monitor running processes / wait for them to complete # depending on whether or not the user has specified -verbose or -debug option - if app._verbosity > 1: + if app.verbosity > 1: for process in _processes: stderrdata = '' while True: @@ -154,7 +154,7 @@ def command(cmd, exitOnError=True): process.wait() except (KeyboardInterrupt, SystemExit): - app._handler(signal.SIGINT, inspect.currentframe()) + app.handler(signal.SIGINT, inspect.currentframe()) # For any command stdout / stderr data that wasn't either passed to another command or # printed to the terminal during execution, read it here. @@ -179,7 +179,7 @@ def command(cmd, exitOnError=True): _processes = [ ] if error: - app._cleanup = False + app.cleanup = False if exitOnError: caller = inspect.getframeinfo(inspect.stack()[1][0]) app.console('') @@ -187,8 +187,8 @@ def command(cmd, exitOnError=True): sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + app.colourConsole + 'Output of failed command:' + app.colourClear + '\n') sys.stderr.write(error_text) sys.stderr.flush() - if app._tempDir: - with open(os.path.join(app._tempDir, 'error.txt'), 'w') as outfile: + if app.tempDir: + with open(os.path.join(app.tempDir, 'error.txt'), 'w') as outfile: outfile.write(cmd + '\n\n' + error_text + '\n') app.complete() sys.exit(1) @@ -198,8 +198,8 @@ def command(cmd, exitOnError=True): # Only now do we append to the script log, since the command has completed successfully # Note: Writing the command as it was formed as the input to run.command(): # other flags may potentially change if this file is eventually used to resume the script - if app._tempDir: - with open(os.path.join(app._tempDir, 'log.txt'), 'a') as outfile: + if app.tempDir: + with open(os.path.join(app.tempDir, 'log.txt'), 'a') as outfile: outfile.write(cmd + '\n') return (return_stdout, return_stderr) @@ -208,15 +208,14 @@ def command(cmd, exitOnError=True): -#pylint: disable=unused-variable -def function(fn, *args): +def function(fn, *args): #pylint: disable=unused-variable import sys from mrtrix3 import app fnstring = fn.__module__ + '.' + fn.__name__ + '(' + ', '.join(args) + ')' - if app._lastFile: + if app.lastFile: # Check to see if the last file produced in the previous script execution is # intended to be produced by this command; if it is, this will be the last # command that gets skipped by the -continue option @@ -227,17 +226,18 @@ def function(fn, *args): totest = entry.split('=')[1] else: totest = entry - filetotest = [ app._lastFile, os.path.splitext(app._lastFile)[0] ] + filetotest = [ app.lastFile, os.path.splitext(app.lastFile)[0] ] if totest in filetotest: - app.debug('Detected last file \'' + app._lastFile + '\' in function \'' + fnstring + '\'; this is the last run.command() / run.function() call that will be skipped') - app._lastFile = '' + #pylint: disable=unused-variable + app.debug('Detected last file \'' + app.lastFile + '\' in function \'' + fnstring + '\'; this is the last run.command() / run.function() call that will be skipped') + app.lastFile = '' break - if app._verbosity: + if app.verbosity: sys.stderr.write(app.colourExec + 'Skipping function:' + app.colourClear + ' ' + fnstring + '\n') sys.stderr.flush() return - if app._verbosity: + if app.verbosity: sys.stderr.write(app.colourExec + 'Function:' + app.colourClear + ' ' + fnstring + '\n') sys.stderr.flush() @@ -245,8 +245,8 @@ def function(fn, *args): result = fn(*args) # Only now do we append to the script log, since the function has completed successfully - if app._tempDir: - with open(os.path.join(app._tempDir, 'log.txt'), 'a') as outfile: + if app.tempDir: + with open(os.path.join(app.tempDir, 'log.txt'), 'a') as outfile: outfile.write(fnstring + '\n') return result From 95bd4c9b9bb0834a6ac6bfbe01633829a8903b82 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 16 Aug 2017 15:50:19 +1000 Subject: [PATCH 066/538] Scripts: Re-jig -continue functionality Storage of the last successfully-created file in order to disable the -continue skipping functionality is now handled entirely within the run module. It is also better functionalised in order to reduce code duplication between run.command() and run.function(). --- bin/dwipreproc | 4 +-- bin/labelsgmfix | 7 ++--- lib/mrtrix3/app.py | 23 +++++++++------ lib/mrtrix3/run.py | 70 ++++++++++++++++++++++++---------------------- 4 files changed, 55 insertions(+), 49 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index bc1d873c84..610d217dae 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -646,8 +646,8 @@ else: # Volume recombination equation described in Skare and Bammer 2010 run.command('mrcalc volume0.mif weight' + str(pe_indices[0]) + '.mif -mult volume1.mif weight' + str(pe_indices[1]) + '.mif -mult -add weight' + str(pe_indices[0]) + '.mif weight' + str(pe_indices[1]) + '.mif -add -divide 0.0 -max combined' + str(index) + '.mif') combined_image_list.append('combined' + str(index) + '.mif') - os.remove('volume0.mif') - os.remove('volume1.mif') + run.function(os.remove, 'volume0.mif') + run.function(os.remove, 'volume1.mif') file.delTemporary(eddy_output) for index in range(0, len(eddy_config)): diff --git a/bin/labelsgmfix b/bin/labelsgmfix index ed91e82bb9..9d64cc190c 100755 --- a/bin/labelsgmfix +++ b/bin/labelsgmfix @@ -104,7 +104,7 @@ for key, value in structure_map.items(): # Add to the SGM image; don't worry about overlap for now node_index = sgm_lut[value] run.command('mrcalc ' + image_path + ' ' + node_index + ' sgm.mif -if sgm_new.mif') - if not app.lastFile: + if not app.continueOption: run.function(os.remove, 'sgm.mif') run.function(os.rename, 'sgm_new.mif', 'sgm.mif') @@ -123,9 +123,8 @@ for struct in structure_map: image_path = struct + '_mask.mif' index = image.statistic('sgm_new_labels.mif', 'median', image_path) run.command('mrcalc parc.mif ' + index + ' -eq 0 parc.mif -if parc_removed.mif') - if not app.lastFile: - run.function(os.remove, 'parc.mif') - run.function(os.rename, 'parc_removed.mif', 'parc.mif') + run.function(os.remove, 'parc.mif') + run.function(os.rename, 'parc_removed.mif', 'parc.mif') # Insert the new delineations of all SGM structures in a single call # Enforce unsigned integer datatype of output image diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index 4452adc4f2..69a913a10c 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -24,15 +24,13 @@ # - 'force' will be True if the user has requested for existing output files to be # re-written, and at least one output target already exists # - 'mrtrix' provides functionality for interfacing with other MRtrix3 components -# TODO Create class for Continue: Have resume() function that mrtrix3.run can call, -# rather than directly overwriting the lastFile variable # TODO Create named tuple for colours, all settings? -args = '' +args = None cleanup = True cmdline = None config = { } +continueOption = False forceOverwrite = False #pylint: disable=unused-variable -lastFile = '' #pylint: disable=unused-variable numThreads = None #pylint: disable=unused-variable tempDir = '' verbosity = 1 # 0 = quiet; 1 = default; 2 = info; 3 = debug @@ -41,6 +39,12 @@ + + + + + + clearLine = '' colourClear = '' colourConsole = '' @@ -120,8 +124,9 @@ def init(author, synopsis): #pylint: disable=unused-variable def parse(): #pylint: disable=unused-variable import os, sys - global args, cleanup, cmdline, lastFile, numThreads, tempDir, verbosity + global args, cleanup, cmdline, continueOption, numThreads, tempDir, verbosity global clearLine, colourClear, colourConsole, colourDebug, colourError, colourExec, colourWarn + from mrtrix3 import run if not cmdline: sys.stderr.write('Script error: app.init() must be called before app.parse()\n') @@ -175,8 +180,9 @@ def parse(): #pylint: disable=unused-variable cmdline.printCitationWarning() if args.cont: + continueOption = True tempDir = os.path.abspath(args.cont[0]) - lastFile = args.cont[1] #pylint: disable=unused-variable + run.setContinue(args.cont[1]) @@ -202,9 +208,9 @@ def checkOutputPath(path): #pylint: disable=unused-variable def makeTempDir(): #pylint: disable=unused-variable import os, random, string, sys - global args, config + global args, config, continueOption global tempDir, workingDir - if args.cont: + if continueOption: debug('Skipping temporary directory creation due to use of -continue option') return if tempDir: @@ -320,7 +326,6 @@ def warn(text): #pylint: disable=unused-variable - # The Parser class is responsible for setting up command-line parsing for the script. # This includes proper configuration of the argparse functionality, adding standard options # that are common for all scripts, providing a custom help page that is consistent with the diff --git a/lib/mrtrix3/run.py b/lib/mrtrix3/run.py index 621eab9999..870e0f6232 100644 --- a/lib/mrtrix3/run.py +++ b/lib/mrtrix3/run.py @@ -5,6 +5,14 @@ _processes = [ ] +_lastFile = '' + + + +def setContinue(filename): #pylint: disable=unused-variable + _lastFile = filename + + def command(cmd, exitOnError=True): #pylint: disable=unused-variable @@ -18,23 +26,9 @@ def command(cmd, exitOnError=True): #pylint: disable=unused-variable # Vectorise the command string, preserving anything encased within quotation marks cmdsplit = shlex.split(cmd) - if app.lastFile: - # Check to see if the last file produced in the previous script execution is - # intended to be produced by this command; if it is, this will be the last - # command that gets skipped by the -continue option - # It's possible that the file might be defined in a '--option=XXX' style argument - # It's also possible that the filename in the command string has the file extension omitted - for entry in cmdsplit: - if entry.startswith('--') and '=' in entry: - cmdtotest = entry.split('=')[1] - else: - cmdtotest = entry - filetotest = [ app.lastFile, os.path.splitext(app.lastFile)[0] ] - if cmdtotest in filetotest: - app.debug('Detected last file \'' + app.lastFile + '\' in command \'' + cmd + '\'; this is the last run.command() / run.function() call that will be skipped') - #pylint: disable=unused-variable - app.lastFile = '' - break + if _lastFile: + if _triggerContinue(cmdsplit): + app.debug('Detected last file in command \'' + cmd + '\'; this is the last run.command() / run.function() call that will be skipped') if app.verbosity: sys.stderr.write(app.colourExec + 'Skipping command:' + app.colourClear + ' ' + cmd + '\n') sys.stderr.flush() @@ -215,23 +209,9 @@ def function(fn, *args): #pylint: disable=unused-variable fnstring = fn.__module__ + '.' + fn.__name__ + '(' + ', '.join(args) + ')' - if app.lastFile: - # Check to see if the last file produced in the previous script execution is - # intended to be produced by this command; if it is, this will be the last - # command that gets skipped by the -continue option - # It's possible that the file might be defined in a '--option=XXX' style argument - # It's also possible that the filename in the command string has the file extension omitted - for entry in args: - if entry.startswith('--') and '=' in entry: - totest = entry.split('=')[1] - else: - totest = entry - filetotest = [ app.lastFile, os.path.splitext(app.lastFile)[0] ] - if totest in filetotest: - #pylint: disable=unused-variable - app.debug('Detected last file \'' + app.lastFile + '\' in function \'' + fnstring + '\'; this is the last run.command() / run.function() call that will be skipped') - app.lastFile = '' - break + if _lastFile: + if _triggerContinue(args): + app.debug('Detected last file in function \'' + fnstring + '\'; this is the last run.command() / run.function() call that will be skipped') if app.verbosity: sys.stderr.write(app.colourExec + 'Skipping function:' + app.colourClear + ' ' + fnstring + '\n') sys.stderr.flush() @@ -358,3 +338,25 @@ def _shebang(item): return shebang app.debug('File \"' + item + '\": No shebang found') return [] + + + +# New function for handling the -continue command-line option functionality +# Check to see if the last file produced in the previous script execution is +# intended to be produced by this command; if it is, this will be the last +# thing that gets skipped by the -continue option +def _triggerContinue(entries): + global _lastFile + if not _lastFile: + assert False + for entry in entries: + # It's possible that the file might be defined in a '--option=XXX' style argument + # It's also possible that the filename in the command string has the file extension omitted + if entry.startswith('--') and '=' in entry: + totest = entry.split('=')[1] + else: + totest = entry + if totest == _lastFile or totest == os.path.splitext(_lastFile)[0]: + _lastFile = '' + return True + return False From 71b85286f1c47cbcd9d352578890e8cc8ee4cede Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 16 Aug 2017 17:57:36 +1000 Subject: [PATCH 067/538] mrtrix3.image: Changes to header() and statistic() - image.header() has changed how the header elements are imported and stored into a class, such that they are correctly stored as member variables with fixed names and pylint is aware of these names. - image.statistic() now takes arbitrary command-line options for mrstats, so that the -ignorezero and -allvolumes options are exposed in addition to the -mask option. --- bin/dwi2response | 2 +- bin/labelsgmfix | 2 +- lib/mrtrix3/app.py | 5 ---- lib/mrtrix3/dwi2response/dhollander.py | 30 +++++++++---------- lib/mrtrix3/dwi2response/msmt_5tt.py | 6 ++-- lib/mrtrix3/dwi2response/tax.py | 16 +++++------ lib/mrtrix3/image.py | 40 ++++++++++++++++++-------- testing/pylint.rc | 2 +- 8 files changed, 56 insertions(+), 47 deletions(-) diff --git a/bin/dwi2response b/bin/dwi2response index f3fe6b02ee..6ff018f51e 100755 --- a/bin/dwi2response +++ b/bin/dwi2response @@ -97,7 +97,7 @@ app.gotoTempDir() # Check that the brain mask is appropriate if image.header('mask.mif').size[:3] != image.header('dwi.mif').size[:3]: app.error('Dimensions of provided mask image do not match DWI') -if int(image.statistic('mask.mif', 'count', 'mask.mif')) == 0: +if int(image.statistic('mask.mif', 'count', '-mask mask.mif')) == 0: app.error('Input mask does not contain any voxels') diff --git a/bin/labelsgmfix b/bin/labelsgmfix index 9d64cc190c..b0c6cc66a0 100755 --- a/bin/labelsgmfix +++ b/bin/labelsgmfix @@ -121,7 +121,7 @@ run.command('labelconvert sgm_masked.mif ' + sgm_lut_file_path + ' ' + path.from # * Insert the new delineation of that structure for struct in structure_map: image_path = struct + '_mask.mif' - index = image.statistic('sgm_new_labels.mif', 'median', image_path) + index = image.statistic('sgm_new_labels.mif', 'median', '-mask ' + image_path) run.command('mrcalc parc.mif ' + index + ' -eq 0 parc.mif -if parc_removed.mif') run.function(os.remove, 'parc.mif') run.function(os.rename, 'parc_removed.mif', 'parc.mif') diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index 69a913a10c..c30515db09 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -24,7 +24,6 @@ # - 'force' will be True if the user has requested for existing output files to be # re-written, and at least one output target already exists # - 'mrtrix' provides functionality for interfacing with other MRtrix3 components -# TODO Create named tuple for colours, all settings? args = None cleanup = True cmdline = None @@ -41,10 +40,6 @@ - - - - clearLine = '' colourClear = '' colourConsole = '' diff --git a/lib/mrtrix3/dwi2response/dhollander.py b/lib/mrtrix3/dwi2response/dhollander.py index eca0fa73ea..58e6674486 100644 --- a/lib/mrtrix3/dwi2response/dhollander.py +++ b/lib/mrtrix3/dwi2response/dhollander.py @@ -98,23 +98,23 @@ def execute(): #pylint: disable=unused-variable run.command('mrcalc crude_wm.mif 0 safe_mask.mif -if _crudenonwm.mif -datatype bit') # Crude GM versus CSF separation based on SDM. - crudenonwmmedian = image.statistic('safe_sdm.mif', 'median', '_crudenonwm.mif') + crudenonwmmedian = image.statistic('safe_sdm.mif', 'median', '-mask _crudenonwm.mif') run.command('mrcalc _crudenonwm.mif safe_sdm.mif ' + str(crudenonwmmedian) + ' -subtract 0 -if - | mrthreshold - - -mask _crudenonwm.mif | mrcalc _crudenonwm.mif - 0 -if crude_csf.mif -datatype bit') run.command('mrcalc crude_csf.mif 0 _crudenonwm.mif -if crude_gm.mif -datatype bit') # Refine WM: remove high SDM outliers. - crudewmmedian = image.statistic('safe_sdm.mif', 'median', 'crude_wm.mif') + crudewmmedian = image.statistic('safe_sdm.mif', 'median', '-mask crude_wm.mif') run.command('mrcalc crude_wm.mif safe_sdm.mif 0 -if ' + str(crudewmmedian) + ' -gt _crudewmhigh.mif -datatype bit') run.command('mrcalc _crudewmhigh.mif 0 crude_wm.mif -if _crudewmlow.mif -datatype bit') - crudewmQ1 = float(image.statistic('safe_sdm.mif', 'median', '_crudewmlow.mif')) - crudewmQ3 = float(image.statistic('safe_sdm.mif', 'median', '_crudewmhigh.mif')) + crudewmQ1 = float(image.statistic('safe_sdm.mif', 'median', '-mask _crudewmlow.mif')) + crudewmQ3 = float(image.statistic('safe_sdm.mif', 'median', '-mask _crudewmhigh.mif')) crudewmoutlthresh = crudewmQ3 + (crudewmQ3 - crudewmQ1) run.command('mrcalc crude_wm.mif safe_sdm.mif 0 -if ' + str(crudewmoutlthresh) + ' -gt _crudewmoutliers.mif -datatype bit') run.command('mrcalc _crudewmoutliers.mif 0 crude_wm.mif -if refined_wm.mif -datatype bit') # Refine GM: separate safer GM from partial volumed voxels. - crudegmmedian = image.statistic('safe_sdm.mif', 'median', 'crude_gm.mif') + crudegmmedian = image.statistic('safe_sdm.mif', 'median', '-mask crude_gm.mif') run.command('mrcalc crude_gm.mif safe_sdm.mif 0 -if ' + str(crudegmmedian) + ' -gt _crudegmhigh.mif -datatype bit') run.command('mrcalc _crudegmhigh.mif 0 crude_gm.mif -if _crudegmlow.mif -datatype bit') run.command('mrcalc _crudegmhigh.mif safe_sdm.mif ' + str(crudegmmedian) + ' -subtract 0 -if - | mrthreshold - - -mask _crudegmhigh.mif -invert | mrcalc _crudegmhigh.mif - 0 -if _crudegmhighselect.mif -datatype bit') @@ -122,13 +122,13 @@ def execute(): #pylint: disable=unused-variable run.command('mrcalc _crudegmhighselect.mif 1 _crudegmlowselect.mif -if refined_gm.mif -datatype bit') # Refine CSF: recover lost CSF from crude WM SDM outliers, separate safer CSF from partial volumed voxels. - crudecsfmin = image.statistic('safe_sdm.mif', 'min', 'crude_csf.mif') + crudecsfmin = image.statistic('safe_sdm.mif', 'min', '-mask crude_csf.mif') run.command('mrcalc _crudewmoutliers.mif safe_sdm.mif 0 -if ' + str(crudecsfmin) + ' -gt 1 crude_csf.mif -if _crudecsfextra.mif -datatype bit') run.command('mrcalc _crudecsfextra.mif safe_sdm.mif ' + str(crudecsfmin) + ' -subtract 0 -if - | mrthreshold - - -mask _crudecsfextra.mif | mrcalc _crudecsfextra.mif - 0 -if refined_csf.mif -datatype bit') # Get final voxels for single-fibre WM response function estimation from WM using 'tournier' algorithm. - refwmcount = float(image.statistic('refined_wm.mif', 'count', 'refined_wm.mif')) + refwmcount = float(image.statistic('refined_wm.mif', 'count', '-mask refined_wm.mif')) voxsfwmcount = int(round(refwmcount * app.args.sfwm / 100.0)) app.console('Running \'tournier\' algorithm to select ' + str(voxsfwmcount) + ' single-fibre WM voxels.') cleanopt = '' @@ -137,11 +137,11 @@ def execute(): #pylint: disable=unused-variable run.command('dwi2response tournier dwi.mif _respsfwmss.txt -sf_voxels ' + str(voxsfwmcount) + ' -iter_voxels ' + str(voxsfwmcount * 10) + ' -mask refined_wm.mif -voxels voxels_sfwm.mif -tempdir ' + app.tempDir + cleanopt) # Get final voxels for GM response function estimation from GM. - refgmmedian = image.statistic('safe_sdm.mif', 'median', 'refined_gm.mif') + refgmmedian = image.statistic('safe_sdm.mif', 'median', '-mask refined_gm.mif') run.command('mrcalc refined_gm.mif safe_sdm.mif 0 -if ' + str(refgmmedian) + ' -gt _refinedgmhigh.mif -datatype bit') run.command('mrcalc _refinedgmhigh.mif 0 refined_gm.mif -if _refinedgmlow.mif -datatype bit') - refgmhighcount = float(image.statistic('_refinedgmhigh.mif', 'count', '_refinedgmhigh.mif')) - refgmlowcount = float(image.statistic('_refinedgmlow.mif', 'count', '_refinedgmlow.mif')) + refgmhighcount = float(image.statistic('_refinedgmhigh.mif', 'count', '-mask _refinedgmhigh.mif')) + refgmlowcount = float(image.statistic('_refinedgmlow.mif', 'count', '-mask _refinedgmlow.mif')) voxgmhighcount = int(round(refgmhighcount * app.args.gm / 100.0)) voxgmlowcount = int(round(refgmlowcount * app.args.gm / 100.0)) run.command('mrcalc _refinedgmhigh.mif safe_sdm.mif 0 -if - | mrthreshold - - -bottom ' + str(voxgmhighcount) + ' -ignorezero | mrcalc _refinedgmhigh.mif - 0 -if _refinedgmhighselect.mif -datatype bit') @@ -149,7 +149,7 @@ def execute(): #pylint: disable=unused-variable run.command('mrcalc _refinedgmhighselect.mif 1 _refinedgmlowselect.mif -if voxels_gm.mif -datatype bit') # Get final voxels for CSF response function estimation from CSF. - refcsfcount = float(image.statistic('refined_csf.mif', 'count', 'refined_csf.mif')) + refcsfcount = float(image.statistic('refined_csf.mif', 'count', '-mask refined_csf.mif')) voxcsfcount = int(round(refcsfcount * app.args.csf / 100.0)) run.command('mrcalc refined_csf.mif safe_sdm.mif 0 -if - | mrthreshold - - -top ' + str(voxcsfcount) + ' -ignorezero | mrcalc refined_csf.mif - 0 -if voxels_csf.mif -datatype bit') @@ -157,10 +157,10 @@ def execute(): #pylint: disable=unused-variable # Show summary of voxels counts. textarrow = ' --> ' app.console('Summary of voxel counts:') - app.console('Mask: ' + str(int(image.statistic('mask.mif', 'count', 'mask.mif'))) + textarrow + str(int(image.statistic('eroded_mask.mif', 'count', 'eroded_mask.mif'))) + textarrow + str(int(image.statistic('safe_mask.mif', 'count', 'safe_mask.mif')))) - app.console('WM: ' + str(int(image.statistic('crude_wm.mif', 'count', 'crude_wm.mif'))) + textarrow + str(int(image.statistic('refined_wm.mif', 'count', 'refined_wm.mif'))) + textarrow + str(int(image.statistic('voxels_sfwm.mif', 'count', 'voxels_sfwm.mif'))) + ' (SF)') - app.console('GM: ' + str(int(image.statistic('crude_gm.mif', 'count', 'crude_gm.mif'))) + textarrow + str(int(image.statistic('refined_gm.mif', 'count', 'refined_gm.mif'))) + textarrow + str(int(image.statistic('voxels_gm.mif', 'count', 'voxels_gm.mif')))) - app.console('CSF: ' + str(int(image.statistic('crude_csf.mif', 'count', 'crude_csf.mif'))) + textarrow + str(int(image.statistic('refined_csf.mif', 'count', 'refined_csf.mif'))) + textarrow + str(int(image.statistic('voxels_csf.mif', 'count', 'voxels_csf.mif')))) + app.console('Mask: ' + str(int(image.statistic('mask.mif', 'count', '-mask mask.mif'))) + textarrow + str(int(image.statistic('eroded_mask.mif', 'count', '-mask eroded_mask.mif'))) + textarrow + str(int(image.statistic('safe_mask.mif', 'count', '-mask safe_mask.mif')))) + app.console('WM: ' + str(int(image.statistic('crude_wm.mif', 'count', '-mask crude_wm.mif'))) + textarrow + str(int(image.statistic('refined_wm.mif', 'count', '-mask refined_wm.mif'))) + textarrow + str(int(image.statistic('voxels_sfwm.mif', 'count', '-mask voxels_sfwm.mif'))) + ' (SF)') + app.console('GM: ' + str(int(image.statistic('crude_gm.mif', 'count', '-mask crude_gm.mif'))) + textarrow + str(int(image.statistic('refined_gm.mif', 'count', '-mask refined_gm.mif'))) + textarrow + str(int(image.statistic('voxels_gm.mif', 'count', '-mask voxels_gm.mif')))) + app.console('CSF: ' + str(int(image.statistic('crude_csf.mif', 'count', '-mask crude_csf.mif'))) + textarrow + str(int(image.statistic('refined_csf.mif', 'count', '-mask refined_csf.mif'))) + textarrow + str(int(image.statistic('voxels_csf.mif', 'count', '-mask voxels_csf.mif')))) # Generate single-fibre WM, GM and CSF responses diff --git a/lib/mrtrix3/dwi2response/msmt_5tt.py b/lib/mrtrix3/dwi2response/msmt_5tt.py index adafee5c80..ad4e2e14b8 100644 --- a/lib/mrtrix3/dwi2response/msmt_5tt.py +++ b/lib/mrtrix3/dwi2response/msmt_5tt.py @@ -80,9 +80,9 @@ def execute(): #pylint: disable=unused-variable run.command('dwi2response ' + app.args.wm_algo + ' dwi.mif wm_ss_response.txt -mask wm_mask.mif -voxels wm_sf_mask.mif -tempdir ' + app.tempDir + recursive_cleanup_option) # Check for empty masks - wm_voxels = int(image.statistic('wm_sf_mask.mif', 'count', 'wm_sf_mask.mif')) - gm_voxels = int(image.statistic('gm_mask.mif', 'count', 'gm_mask.mif')) - csf_voxels = int(image.statistic('csf_mask.mif', 'count', 'csf_mask.mif')) + wm_voxels = int(image.statistic('wm_sf_mask.mif', 'count', '-mask wm_sf_mask.mif')) + gm_voxels = int(image.statistic('gm_mask.mif', 'count', '-mask gm_mask.mif')) + csf_voxels = int(image.statistic('csf_mask.mif', 'count', '-mask csf_mask.mif')) empty_masks = [ ] if not wm_voxels: empty_masks.append('WM') diff --git a/lib/mrtrix3/dwi2response/tax.py b/lib/mrtrix3/dwi2response/tax.py index b85b699e9e..c48cfa31f3 100644 --- a/lib/mrtrix3/dwi2response/tax.py +++ b/lib/mrtrix3/dwi2response/tax.py @@ -48,14 +48,12 @@ def execute(): #pylint: disable=unused-variable if iteration == 0: RF_in_path = 'init_RF.txt' mask_in_path = 'mask.mif' - # TODO This can be changed once #71 is implemented (mrstats statistics across volumes) - volume_means = [float(x) for x in image.statistic('dwi.mif', 'mean', 'mask.mif').split()] - mean = sum(volume_means) / float(len(volume_means)) - volume_stds = [float(x) for x in image.statistic('dwi.mif', 'std', 'mask.mif').split()] - std = sum(volume_stds) / float(len(volume_stds)) - # Scale these to reflect the fact that we're moving to the SH basis - mean *= math.sqrt(4.0 * math.pi) - std *= math.sqrt(4.0 * math.pi) + + # Grab the mean and standard deviation across all volumes in a single mrstats call + # Also scale them to reflect the fact that we're moving to the SH basis + mean = float(image.statistic('dwi.mif', 'mean', '-mask mask.mif -allvolumes')) * math.sqrt(4.0 * math.pi) + std = float(image.statistic('dwi.mif', 'std', '-mask mask.mif -allvolumes')) * math.sqrt(4.0 * math.pi) + # Now produce the initial response function # Let's only do it to lmax 4 init_RF = [ str(mean), str(-0.5*std), str(0.25*std*std/mean) ] @@ -85,7 +83,7 @@ def execute(): #pylint: disable=unused-variable run.command('mrcalc ' + prefix + 'peak_ratio.mif ' + str(app.args.peak_ratio) + ' -lt ' + mask_in_path + ' -mult ' + prefix + 'SF.mif -datatype bit') file.delTemporary(prefix + 'peak_ratio.mif') # Make sure image isn't empty - SF_voxel_count = int(image.statistic(prefix + 'SF.mif', 'count', prefix + 'SF.mif')) + SF_voxel_count = int(image.statistic(prefix + 'SF.mif', 'count', '-mask ' + prefix + 'SF.mif')) if not SF_voxel_count: app.error('Aborting: All voxels have been excluded from single-fibre selection') # Generate a new response function diff --git a/lib/mrtrix3/image.py b/lib/mrtrix3/image.py index eaab1e3636..5326312ded 100644 --- a/lib/mrtrix3/image.py +++ b/lib/mrtrix3/image.py @@ -33,13 +33,30 @@ def header(image_path): app.error('Could not access header information for image \'' + image_path + '\'') with open(filename, 'r') as f: elements = json.load(f) - if not hasattr(elements, 'keyval') or not elements.keyval: - elements.keyval = {} - os.remove(filename) - if not isHeader(elements): + + class _Header: + def __init__(self, data): + #self.__dict__.update(data) + # Load the individual header elements manually, so that pylint knows that they'll be there + self.name = data['name'] + self.size = data['size'] + self.spacing = data['spacing'] + self.stride = data['stride'] + self.format = data['format'] + self.datatype = data['datatype'] + self.intensity_offset = data['intensity_offset'] + self.intensity_scale = data['intensity_scale'] + self.transform = data['transform'] + if not 'keyval' in data or not data['keyval']: + self.keyval = { } + + try: + result = _Header(elements) + except: app.error('Error in reading header information from file \'' + image_path + '\'') - app.debug(vars(elements)) - return elements + os.remove(filename) + app.debug(str(vars(result))) + return result @@ -115,14 +132,13 @@ def match(image_one, image_two): #pylint: disable=unused-variable -# TODO Change mask_path to instead receive a string of additional command-line options -# (that way, -allvolumes can be used) -def statistic(image_path, stat, mask_path = ''): #pylint: disable=unused-variable - import subprocess +# Computes image statistics using mrstats. +def statistic(image_path, stat, options=''): #pylint: disable=unused-variable + import shlex, subprocess from mrtrix3 import app, run command = [ run.exeName(run.versionMatch('mrstats')), image_path, '-output', stat ] - if mask_path: - command.extend([ '-mask', mask_path ]) + if options: + command.extend(shlex.split(options)) if app.verbosity > 1: app.console('Command: \'' + ' '.join(command) + '\' (piping data to local storage)') proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=None) diff --git a/testing/pylint.rc b/testing/pylint.rc index 3d055670ae..61a7a450a3 100644 --- a/testing/pylint.rc +++ b/testing/pylint.rc @@ -277,7 +277,7 @@ min-similarity-lines=4 [MISCELLANEOUS] # List of note tags to take in consideration, separated by a comma. -notes=FIXME,XXX,TODO +notes=FIXME,XXX,TODO,TESTME [SPELLING] From 99795829e310a4f6cbf78b0168cac0aa1d648e8a Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 16 Aug 2017 18:38:52 +1000 Subject: [PATCH 068/538] Scripts: More fixes for pylint testing changes - Alter the copy-paste code at the top of each Python binary that finds the lib directory of the relevant MRtrix3 installation and adds it to the python path. It now works when the script is run from a softlink. - Fix residual issue in image.header() function: not writing keyval field. - Alter path.scriptSubDirName() to also work when the master script is run through a softlink. Note that this now results in run_pylint passing all tests for the first time. --- bin/5ttgen | 2 +- bin/dwi2response | 2 +- bin/dwibiascorrect | 2 +- bin/dwigradcheck | 2 +- bin/dwiintensitynorm | 2 +- bin/dwipreproc | 2 +- bin/labelsgmfix | 2 +- bin/population_template | 2 +- lib/mrtrix3/image.py | 2 ++ lib/mrtrix3/path.py | 10 ++++++++-- 10 files changed, 18 insertions(+), 10 deletions(-) diff --git a/bin/5ttgen b/bin/5ttgen index a629fa8024..c5ef05618e 100755 --- a/bin/5ttgen +++ b/bin/5ttgen @@ -11,7 +11,7 @@ # Make the corresponding MRtrix3 Python libraries available import inspect, os, sys -lib_folder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], os.pardir, 'lib'))) +lib_folder = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(inspect.getfile(inspect.currentframe()))), os.pardir, 'lib')) if not os.path.isdir(lib_folder): sys.stderr.write('Unable to locate MRtrix3 Python libraries') sys.exit(1) diff --git a/bin/dwi2response b/bin/dwi2response index 6ff018f51e..4ac013eed7 100755 --- a/bin/dwi2response +++ b/bin/dwi2response @@ -5,7 +5,7 @@ # Make the corresponding MRtrix3 Python libraries available import inspect, os, sys -lib_folder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], os.pardir, 'lib'))) +lib_folder = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(inspect.getfile(inspect.currentframe()))), os.pardir, 'lib')) if not os.path.isdir(lib_folder): sys.stderr.write('Unable to locate MRtrix3 Python libraries') sys.exit(1) diff --git a/bin/dwibiascorrect b/bin/dwibiascorrect index 0ac1dced5c..b9767ddcec 100755 --- a/bin/dwibiascorrect +++ b/bin/dwibiascorrect @@ -5,7 +5,7 @@ # Make the corresponding MRtrix3 Python libraries available import inspect, os, sys -lib_folder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], os.pardir, 'lib'))) +lib_folder = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(inspect.getfile(inspect.currentframe()))), os.pardir, 'lib')) if not os.path.isdir(lib_folder): sys.stderr.write('Unable to locate MRtrix3 Python libraries') sys.exit(1) diff --git a/bin/dwigradcheck b/bin/dwigradcheck index 8d034a2256..96f724471f 100755 --- a/bin/dwigradcheck +++ b/bin/dwigradcheck @@ -4,7 +4,7 @@ # Make the corresponding MRtrix3 Python libraries available import inspect, os, sys -lib_folder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], os.pardir, 'lib'))) +lib_folder = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(inspect.getfile(inspect.currentframe()))), os.pardir, 'lib')) if not os.path.isdir(lib_folder): sys.stderr.write('Unable to locate MRtrix3 Python libraries') sys.exit(1) diff --git a/bin/dwiintensitynorm b/bin/dwiintensitynorm index fa5de4348e..36433b3650 100755 --- a/bin/dwiintensitynorm +++ b/bin/dwiintensitynorm @@ -3,7 +3,7 @@ # Make the corresponding MRtrix3 Python libraries available import inspect, os, sys -lib_folder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], os.pardir, 'lib'))) +lib_folder = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(inspect.getfile(inspect.currentframe()))), os.pardir, 'lib')) if not os.path.isdir(lib_folder): sys.stderr.write('Unable to locate MRtrix3 Python libraries') sys.exit(1) diff --git a/bin/dwipreproc b/bin/dwipreproc index 610d217dae..05b07da7da 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -16,7 +16,7 @@ # Make the corresponding MRtrix3 Python libraries available import inspect, os, sys -lib_folder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], os.pardir, 'lib'))) +lib_folder = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(inspect.getfile(inspect.currentframe()))), os.pardir, 'lib')) if not os.path.isdir(lib_folder): sys.stderr.write('Unable to locate MRtrix3 Python libraries') sys.exit(1) diff --git a/bin/labelsgmfix b/bin/labelsgmfix index b0c6cc66a0..4c3ccd3b91 100755 --- a/bin/labelsgmfix +++ b/bin/labelsgmfix @@ -10,7 +10,7 @@ # Make the corresponding MRtrix3 Python libraries available import inspect, os, sys -lib_folder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], os.pardir, 'lib'))) +lib_folder = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(inspect.getfile(inspect.currentframe()))), os.pardir, 'lib')) if not os.path.isdir(lib_folder): sys.stderr.write('Unable to locate MRtrix3 Python libraries') sys.exit(1) diff --git a/bin/population_template b/bin/population_template index f144f8475b..c7e83b9dc6 100755 --- a/bin/population_template +++ b/bin/population_template @@ -4,7 +4,7 @@ # Make the corresponding MRtrix3 Python libraries available import inspect, os, sys -lib_folder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], os.pardir, 'lib'))) +lib_folder = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(inspect.getfile(inspect.currentframe()))), os.pardir, 'lib')) if not os.path.isdir(lib_folder): sys.stderr.write('Unable to locate MRtrix3 Python libraries') sys.exit(1) diff --git a/lib/mrtrix3/image.py b/lib/mrtrix3/image.py index 5326312ded..9dc9a7286c 100644 --- a/lib/mrtrix3/image.py +++ b/lib/mrtrix3/image.py @@ -49,6 +49,8 @@ def __init__(self, data): self.transform = data['transform'] if not 'keyval' in data or not data['keyval']: self.keyval = { } + else: + self.keyval = data['keyval'] try: result = _Header(elements) diff --git a/lib/mrtrix3/path.py b/lib/mrtrix3/path.py index 1d2aff7501..18cfab06b2 100644 --- a/lib/mrtrix3/path.py +++ b/lib/mrtrix3/path.py @@ -70,8 +70,14 @@ def newTemporary(suffix): #pylint: disable=unused-variable def scriptSubDirName(): #pylint: disable=unused-variable import inspect, os from mrtrix3 import app - # TODO Test this on multiple Python versions, with & without softlinking - name = os.path.basename(inspect.stack()[-1][1]) + frameinfo = inspect.stack()[-1] + try: + frame = frameinfo.frame + except: # Prior to Version 3.5 + frame = frameinfo[0] + # If the script has been run through a softlink, we need the name of the original + # script in order to locate the additional data + name = os.path.basename(os.path.realpath(inspect.getfile(frame))) if not name[0].isalpha(): name = '_' + name app.debug(name) From 470020e28daa632e03e3afe99e7606af47208b83 Mon Sep 17 00:00:00 2001 From: Rami Tabbara Date: Thu, 27 Jul 2017 15:11:39 +1000 Subject: [PATCH 069/538] mrview: Tractography: Adding line and point geometry As requested in #708 --- .../mrview/tool/tractography/tractogram.cpp | 49 ++++++--- src/gui/mrview/tool/tractography/tractogram.h | 11 +- .../mrview/tool/tractography/tractography.cpp | 103 +++++++++++++++++- .../mrview/tool/tractography/tractography.h | 9 ++ 4 files changed, 152 insertions(+), 20 deletions(-) diff --git a/src/gui/mrview/tool/tractography/tractogram.cpp b/src/gui/mrview/tool/tractography/tractogram.cpp index e19d14b05a..4ab795b6c4 100644 --- a/src/gui/mrview/tool/tractography/tractogram.cpp +++ b/src/gui/mrview/tool/tractography/tractogram.cpp @@ -118,6 +118,9 @@ namespace MR std::string Tractogram::Shader::geometry_shader_source (const Displayable&) { + if (geometry_type != TrackGeometryType::Pseudotubes) + return std::string(); + std::string source = "layout(lines) in;\n" "layout(triangle_strip, max_vertices = 4) out;\n" @@ -209,6 +212,7 @@ namespace MR std::string Tractogram::Shader::fragment_shader_source (const Displayable& displayable) { const Tractogram& tractogram = dynamic_cast(displayable); + bool using_geom = geometry_type == TrackGeometryType::Pseudotubes; std::string source = "uniform float lower, upper;\n" @@ -219,35 +223,39 @@ namespace MR if (color_type == TrackColourType::ScalarFile || color_type == TrackColourType::Ends) source += "in vec3 fColour;\n"; if (use_lighting || color_type == TrackColourType::Direction) - source += "in vec3 g_tangent;\n"; + source += using_geom ? "in vec3 g_tangent;\n" : "in vec3 v_tangent;\n"; if (threshold_type != TrackThresholdType::None) - source += "in float g_amp;\n"; + source += using_geom ? "in float g_amp;\n" : "in vec3 v_amp;\n"; - if (use_lighting) - source += + if (use_lighting && using_geom) + source += "uniform float ambient, diffuse, specular, shine;\n" "uniform vec3 light_pos;\n" "in float g_height;\n"; if (do_crop_to_slab) - source += "in float g_include;\n"; + source += using_geom ? "in float g_include;\n" : "in float v_include;\n"; source += "void main() {\n"; if (do_crop_to_slab) - source += - " if (g_include < 0.0 || g_include > 1.0) discard;\n"; + source += using_geom ? + " if (g_include < 0.0 || g_include > 1.0) discard;\n" + : " if (v_include < 0.0 || v_include > 1.0) discard;\n"; if (threshold_type != TrackThresholdType::None) { if (tractogram.use_discard_lower()) - source += " if (g_amp < lower) discard;\n"; + source += using_geom ? " if (g_amp < lower) discard;\n" + : " if (v_amp < lower) discard;\n"; if (tractogram.use_discard_upper()) - source += " if (g_amp > upper) discard;\n"; + source += using_geom ? " if (g_amp > upper) discard;\n" + : " if (v_amp > upper) discard;\n"; } switch (color_type) { case TrackColourType::Direction: - source += " colour = abs (normalize (g_tangent));\n"; + source += using_geom ? " colour = abs (normalize (g_tangent));\n" + : " colour = abs (normalize (v_tangent));\n"; break; case TrackColourType::ScalarFile: source += " colour = fColour;\n"; @@ -259,7 +267,7 @@ namespace MR source += " colour = const_colour;\n"; } - if (use_lighting) + if (use_lighting && using_geom) // g_height tells us where we are across the cylinder (0 - PI) source += // compute surface normal: @@ -298,6 +306,8 @@ namespace MR return true; if (use_lighting != tractogram.tractography_tool.use_lighting) return true; + if (geometry_type != tractogram.geometry_type) + return true; return Displayable::Shader::need_update (object); } @@ -312,6 +322,7 @@ namespace MR use_lighting = tractogram.tractography_tool.use_lighting; color_type = tractogram.color_type; threshold_type = tractogram.threshold_type; + geometry_type = tractogram.geometry_type; Displayable::Shader::update (object); } @@ -331,6 +342,7 @@ namespace MR filename (filename), color_type (TrackColourType::Direction), threshold_type (TrackThresholdType::None), + geometry_type (TrackGeometryType::Line), sample_stride (0), vao_dirty (true), threshold_min (NaN), @@ -417,7 +429,9 @@ namespace MR original_fov = std::pow (dim[0]*dim[1]*dim[2], 1.0f/3.0f); } - line_thickness_screenspace = tractography_tool.line_thickness*original_fov*(transform.width()+transform.height()) / ( 2.0*window().FOV()*transform.width()*transform.height()); + line_thickness_screenspace = geometry_type != TrackGeometryType::Pseudotubes ? 1.f : + tractography_tool.line_thickness*original_fov*(transform.width()+transform.height()) / + ( 2.0*window().FOV()*transform.width()*transform.height()); gl::Uniform1f (gl::GetUniformLocation (track_shader, "line_thickness"), line_thickness_screenspace); gl::Uniform1f (gl::GetUniformLocation (track_shader, "scale_x"), transform.width()); @@ -502,7 +516,11 @@ namespace MR track_starts[buf][j] = (GLint) (std::ceil (original_track_starts[buf][j] / (float)sample_stride)) - 1; } } - gl::MultiDrawArrays (gl::LINE_STRIP, &track_starts[buf][0], &track_sizes[buf][0], num_tracks_per_buffer[buf]); + + if (geometry_type == TrackGeometryType::Points) + gl::MultiDrawArrays (gl::POINTS, &track_starts[buf][0], &track_sizes[buf][0], num_tracks_per_buffer[buf]); + else + gl::MultiDrawArrays (gl::LINE_STRIP, &track_starts[buf][0], &track_sizes[buf][0], num_tracks_per_buffer[buf]); } vao_dirty = false; @@ -871,6 +889,11 @@ namespace MR } + void Tractogram::set_geometry_type (const TrackGeometryType t) + { + geometry_type = t; + } + void Tractogram::load_tracks_onto_GPU (vector& buffer, vector& starts, diff --git a/src/gui/mrview/tool/tractography/tractogram.h b/src/gui/mrview/tool/tractography/tractogram.h index 41afa4ca48..6c5575a24a 100644 --- a/src/gui/mrview/tool/tractography/tractogram.h +++ b/src/gui/mrview/tool/tractography/tractogram.h @@ -36,6 +36,10 @@ namespace MR namespace Tool { + enum class TrackColourType { Direction, Ends, Manual, ScalarFile }; + enum class TrackGeometryType { Line, Pseudotubes, Points }; + enum class TrackThresholdType { None, UseColourFile, SeparateFile }; + class Tractogram : public Displayable { MEMALIGN(Tractogram) Q_OBJECT @@ -65,8 +69,10 @@ namespace MR void set_color_type (const TrackColourType); void set_threshold_type (const TrackThresholdType); + void set_geometry_type (const TrackGeometryType); TrackColourType get_color_type() const { return color_type; } TrackThresholdType get_threshold_type() const { return threshold_type; } + TrackGeometryType get_geometry_type() const { return geometry_type; } void set_colour (float c[3]) { colour = { c[0], c[1], c[2] }; } @@ -96,7 +102,8 @@ namespace MR do_crop_to_slab (false), use_lighting (false), color_type (TrackColourType::Direction), - threshold_type (TrackThresholdType::None) { } + threshold_type (TrackThresholdType::None), + geometry_type (TrackGeometryType::Line) { } std::string vertex_shader_source (const Displayable&) override; std::string fragment_shader_source (const Displayable&) override; std::string geometry_shader_source (const Displayable&) override; @@ -106,6 +113,7 @@ namespace MR bool do_crop_to_slab, use_lighting; TrackColourType color_type; TrackThresholdType threshold_type; + TrackGeometryType geometry_type; } track_shader; @@ -120,6 +128,7 @@ namespace MR TrackColourType color_type; TrackThresholdType threshold_type; + TrackGeometryType geometry_type; // Instead of tracking the file path, pre-calculate the // streamline tangents and store them; then, if colour by diff --git a/src/gui/mrview/tool/tractography/tractography.cpp b/src/gui/mrview/tool/tractography/tractography.cpp index ba142daf11..806ebebb81 100644 --- a/src/gui/mrview/tool/tractography/tractography.cpp +++ b/src/gui/mrview/tool/tractography/tractography.cpp @@ -158,6 +158,22 @@ namespace MR main_box->addLayout (hlayout); + hlayout = new HBoxLayout; + hlayout->setContentsMargins (0, 0, 0, 0); + hlayout->setSpacing (0); + + hlayout->addWidget (new QLabel ("geometry")); + + geom_type_combobox = new ComboBoxWithErrorMsg (this, "(variable)"); + geom_type_combobox->setToolTip (tr ("Set the tractogram geometry type")); + geom_type_combobox->addItem ("Lines"); + geom_type_combobox->addItem ("Pseudotubes"); + geom_type_combobox->addItem ("Points"); + connect (geom_type_combobox, SIGNAL (activated(int)), this, SLOT (geom_type_selection_slot (int))); + hlayout->addWidget (geom_type_combobox); + + main_box->addLayout (hlayout); + scalar_file_options = new TrackScalarFileOptions (this); main_box->addWidget (scalar_file_options); @@ -179,7 +195,8 @@ namespace MR thickness_slider->setRange (-1000,1000); thickness_slider->setSliderPosition (0); connect (thickness_slider, SIGNAL (valueChanged (int)), this, SLOT (line_thickness_slot (int))); - general_opt_grid->addWidget (new QLabel ("line thickness"), 1, 0); + thickness_label = new QLabel ("thickness"); + general_opt_grid->addWidget (thickness_label, 1, 0); general_opt_grid->addWidget (thickness_slider, 1, 1); slab_group_box = new QGroupBox (tr("crop to slab")); @@ -198,7 +215,7 @@ namespace MR connect (slab_entry, SIGNAL (valueChanged()), this, SLOT (on_slab_thickness_slot())); slab_layout->addWidget (slab_entry, 0, 1); - QGroupBox* lighting_group_box = new QGroupBox (tr("use lighting")); + lighting_group_box = new QGroupBox (tr("use lighting")); lighting_group_box->setCheckable (true); lighting_group_box->setChecked (false); general_opt_grid->addWidget (lighting_group_box, 5, 0, 1, 2); @@ -206,7 +223,7 @@ namespace MR connect (lighting_group_box, SIGNAL (clicked (bool)), this, SLOT (on_use_lighting_slot (bool))); VBoxLayout* lighting_layout = new VBoxLayout (lighting_group_box); - QPushButton* lighting_button = new QPushButton ("Track lighting..."); + lighting_button = new QPushButton ("Track lighting..."); lighting_button->setIcon (QIcon (":/light.svg")); connect (lighting_button, SIGNAL (clicked()), this, SLOT (on_lighting_settings())); lighting_layout->addWidget (lighting_button); @@ -236,6 +253,8 @@ namespace MR action = new QAction("&Colour by (track) scalar file", this); connect (action, SIGNAL(triggered()), this, SLOT (colour_by_scalar_file_slot())); track_option_menu->addAction (action); + + update_geometry_type_gui(); } @@ -574,7 +593,7 @@ namespace MR } - void Tractography::colour_mode_selection_slot (int /*unused*/) + void Tractography::colour_mode_selection_slot (int) { switch (colour_combobox->currentIndex()) { case 0: colour_track_by_direction_slot(); break; @@ -608,9 +627,37 @@ namespace MR } + + void Tractography::geom_type_selection_slot(int selected_index) + { + TrackGeometryType geom_type = TrackGeometryType::Line; + + switch (selected_index) { + case 1: + geom_type = TrackGeometryType::Pseudotubes; + break; + case 2: + geom_type = TrackGeometryType::Points; + default: + break; + } + + QModelIndexList indices = tractogram_list_view->selectionModel()->selectedIndexes(); + for (int i = 0; i < indices.size(); ++i) + tractogram_list_model->get_tractogram (indices[i])->set_geometry_type (geom_type); + + update_geometry_type_gui(); + + window().updateGL(); + } + + + void Tractography::selection_changed_slot (const QItemSelection &, const QItemSelection &) { update_scalar_options(); + update_geometry_type_gui(); + QModelIndexList indices = tractogram_list_view->selectionModel()->selectedIndexes(); if (!indices.size()) { colour_combobox->setEnabled (false); @@ -618,8 +665,11 @@ namespace MR return; } colour_combobox->setEnabled (true); - TrackColourType color_type = tractogram_list_model->get_tractogram (indices[0])->get_color_type(); - Eigen::Array3f color = tractogram_list_model->get_tractogram (indices[0])->colour; + + const Tractogram* first_tractogram = tractogram_list_model->get_tractogram (indices[0]); + + TrackColourType color_type = first_tractogram->get_color_type(); + Eigen::Array3f color = first_tractogram->colour; bool color_type_consistent = true; for (int i = 1; i != indices.size(); ++i) { const Tractogram* tractogram = tractogram_list_model->get_tractogram (indices[i]); @@ -654,6 +704,20 @@ namespace MR } else { colour_combobox->setError(); } + + TrackGeometryType geom_type = first_tractogram->get_geometry_type(); + int geom_combobox_index = 0; + switch (geom_type) { + case TrackGeometryType::Pseudotubes: + geom_combobox_index = 1; + break; + case TrackGeometryType::Points: + geom_combobox_index = 2; + break; + default: + break; + } + geom_type_combobox->setCurrentIndex(geom_combobox_index); } @@ -670,6 +734,33 @@ namespace MR + void Tractography::update_geometry_type_gui() + { + thickness_slider->setHidden (true); + thickness_label->setHidden (true); + lighting_button->setEnabled (false); + lighting_group_box->setEnabled (false); + geom_type_combobox->setEnabled (false); + + QModelIndexList indices = tractogram_list_view->selectionModel()->selectedIndexes(); + if (!indices.size()) + return; + + geom_type_combobox->setEnabled (true); + + const Tractogram* first_tractogram = tractogram_list_model->get_tractogram (indices[0]); + TrackGeometryType geom_type = first_tractogram->get_geometry_type(); + + if (geom_type == TrackGeometryType::Pseudotubes) { + thickness_slider->setHidden (false); + thickness_label->setHidden (false); + lighting_button->setEnabled (true); + lighting_group_box->setEnabled (true); + } + } + + + void Tractography::add_commandline_options (MR::App::OptionList& options) { diff --git a/src/gui/mrview/tool/tractography/tractography.h b/src/gui/mrview/tool/tractography/tractography.h index 6f35bc1c13..557ee7253c 100644 --- a/src/gui/mrview/tool/tractography/tractography.h +++ b/src/gui/mrview/tool/tractography/tractography.h @@ -89,6 +89,7 @@ namespace MR void colour_by_scalar_file_slot (); void colour_mode_selection_slot (int); void colour_button_slot(); + void geom_type_selection_slot (int); void selection_changed_slot (const QItemSelection &, const QItemSelection &); protected: @@ -98,19 +99,27 @@ namespace MR ComboBoxWithErrorMsg *colour_combobox; QColorButton *colour_button; + ComboBoxWithErrorMsg *geom_type_combobox; + TrackScalarFileOptions *scalar_file_options; LightingDock *lighting_dock; QGroupBox* slab_group_box; + QGroupBox* lighting_group_box; + QPushButton* lighting_button; + QSlider* opacity_slider; QSlider* thickness_slider; + QLabel* thickness_label; + void dropEvent (QDropEvent* event) override; void update_scalar_options(); void add_tractogram (vector& list); void select_last_added_tractogram(); bool process_commandline_option_tsf_check_tracto_loaded (); bool process_commandline_option_tsf_option (const MR::App::ParsedOption&, uint, vector& range); + void update_geometry_type_gui(); }; } From f91e04dfc78bf57fe6481846b08a9db6ad99156f Mon Sep 17 00:00:00 2001 From: Rami Tabbara Date: Thu, 27 Jul 2017 16:25:47 +1000 Subject: [PATCH 070/538] mrview: Tractography: Fix endpoint/trackfile colouring when rendering lines/points --- src/gui/mrview/tool/tractography/tractogram.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/mrview/tool/tractography/tractogram.cpp b/src/gui/mrview/tool/tractography/tractogram.cpp index 4ab795b6c4..430ed8e4a9 100644 --- a/src/gui/mrview/tool/tractography/tractogram.cpp +++ b/src/gui/mrview/tool/tractography/tractogram.cpp @@ -221,7 +221,7 @@ namespace MR "out vec3 colour;\n"; if (color_type == TrackColourType::ScalarFile || color_type == TrackColourType::Ends) - source += "in vec3 fColour;\n"; + source += using_geom ? "in vec3 fColour;\n" : "in vec3 v_colour;\n"; if (use_lighting || color_type == TrackColourType::Direction) source += using_geom ? "in vec3 g_tangent;\n" : "in vec3 v_tangent;\n"; @@ -258,10 +258,12 @@ namespace MR : " colour = abs (normalize (v_tangent));\n"; break; case TrackColourType::ScalarFile: - source += " colour = fColour;\n"; + source += using_geom ? " colour = fColour;\n" + : " colour = v_colour;\n"; break; case TrackColourType::Ends: - source += " colour = fColour;\n"; + source += using_geom ? " colour = fColour;\n" + : " colour = v_colour;\n"; break; case TrackColourType::Manual: source += " colour = const_colour;\n"; From ff67d98af191f2745dd3d55e2fd21c6e41512cc1 Mon Sep 17 00:00:00 2001 From: Rami Tabbara Date: Mon, 7 Aug 2017 17:58:12 +1000 Subject: [PATCH 071/538] mrview: Tract geom: Support large point size geometry * Added support for point size geometry > 1px * Avoid potentially skipping vertices when rendering lines/points * Skipping included when rendering pseudotubes to allow smooth rendering of thick streamtube quads (relative to the FoV) --- .../mrview/tool/tractography/tractogram.cpp | 19 ++++++++++++++++++- .../mrview/tool/tractography/tractography.cpp | 9 +++++++++ .../mrview/tool/tractography/tractography.h | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/gui/mrview/tool/tractography/tractogram.cpp b/src/gui/mrview/tool/tractography/tractogram.cpp index 430ed8e4a9..c3419377f2 100644 --- a/src/gui/mrview/tool/tractography/tractogram.cpp +++ b/src/gui/mrview/tool/tractography/tractogram.cpp @@ -213,6 +213,7 @@ namespace MR { const Tractogram& tractogram = dynamic_cast(displayable); bool using_geom = geometry_type == TrackGeometryType::Pseudotubes; + bool using_points = geometry_type == TrackGeometryType::Points; std::string source = "uniform float lower, upper;\n" @@ -238,6 +239,12 @@ namespace MR source += "void main() {\n"; + + if (using_points) + source += + "if(dot(gl_PointCoord-0.5,gl_PointCoord-0.5)>0.25)\n" + " discard;\n"; + if (do_crop_to_slab) source += using_geom ? " if (g_include < 0.0 || g_include > 1.0) discard;\n" @@ -431,7 +438,7 @@ namespace MR original_fov = std::pow (dim[0]*dim[1]*dim[2], 1.0f/3.0f); } - line_thickness_screenspace = geometry_type != TrackGeometryType::Pseudotubes ? 1.f : + line_thickness_screenspace = tractography_tool.line_thickness*original_fov*(transform.width()+transform.height()) / ( 2.0*window().FOV()*transform.width()*transform.height()); @@ -439,6 +446,10 @@ namespace MR gl::Uniform1f (gl::GetUniformLocation (track_shader, "scale_x"), transform.width()); gl::Uniform1f (gl::GetUniformLocation (track_shader, "scale_y"), transform.height()); + float point_size_screenspace = tractography_tool.point_size*original_fov / window().FOV(); + + glPointSize(point_size_screenspace); + if (tractography_tool.line_opacity < 1.0) { gl::Enable (gl::BLEND); gl::BlendEquation (gl::FUNC_ADD); @@ -541,6 +552,11 @@ namespace MR new_stride = std::max (1, std::min (max_sample_stride, new_stride)); } + if (geometry_type == TrackGeometryType::Pseudotubes) { + new_stride = GLint (tractography_tool.line_thickness * original_fov / step_size); + new_stride = std::max (1, std::min (max_sample_stride, new_stride)); + } + if (new_stride != sample_stride) { sample_stride = new_stride; vao_dirty = true; @@ -894,6 +910,7 @@ namespace MR void Tractogram::set_geometry_type (const TrackGeometryType t) { geometry_type = t; + should_update_stride = true; } diff --git a/src/gui/mrview/tool/tractography/tractography.cpp b/src/gui/mrview/tool/tractography/tractography.cpp index 806ebebb81..3001a67f3c 100644 --- a/src/gui/mrview/tool/tractography/tractography.cpp +++ b/src/gui/mrview/tool/tractography/tractography.cpp @@ -25,6 +25,8 @@ // as a fraction of the image FOV: #define MRTRIX_DEFAULT_LINE_THICKNESS 0.002f +#define MRTRIX_DEFAULT_POINT_SIZE 5.f + namespace MR { namespace GUI @@ -67,6 +69,7 @@ namespace MR Tractography::Tractography (Dock* parent) : Base (parent), line_thickness (MRTRIX_DEFAULT_LINE_THICKNESS), + point_size (MRTRIX_DEFAULT_POINT_SIZE), do_crop_to_slab (true), use_lighting (false), not_3D (true), @@ -438,6 +441,7 @@ namespace MR void Tractography::line_thickness_slot (int thickness) { line_thickness = MRTRIX_DEFAULT_LINE_THICKNESS * std::exp (2.0e-3f * thickness); + point_size = MRTRIX_DEFAULT_POINT_SIZE * std::exp (2.0e-3f * thickness); for (size_t i = 0, N = tractogram_list_model->rowCount(); i < N; ++i) { Tractogram* tractogram = dynamic_cast(tractogram_list_model->items[i].get()); @@ -757,6 +761,11 @@ namespace MR lighting_button->setEnabled (true); lighting_group_box->setEnabled (true); } + + if (geom_type == TrackGeometryType::Points) { + thickness_slider->setHidden (false); + thickness_label->setHidden (false); + } } diff --git a/src/gui/mrview/tool/tractography/tractography.h b/src/gui/mrview/tool/tractography/tractography.h index 557ee7253c..e6692c54d8 100644 --- a/src/gui/mrview/tool/tractography/tractography.h +++ b/src/gui/mrview/tool/tractography/tractography.h @@ -59,6 +59,7 @@ namespace MR QPushButton* hide_all_button; float line_thickness; + float point_size; bool do_crop_to_slab; bool use_lighting; bool use_threshold_scalarfile; From 99908496cda7c494f6ec2ab148523553a55fdfc7 Mon Sep 17 00:00:00 2001 From: Rami Tabbara Date: Thu, 17 Aug 2017 10:24:51 +1000 Subject: [PATCH 072/538] mrview: Fixing rebase of tract_geom to dev --- src/gui/mrview/tool/tractography/tractogram.h | 5 ----- src/gui/mrview/tool/tractography/tractogram_enums.h | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/gui/mrview/tool/tractography/tractogram.h b/src/gui/mrview/tool/tractography/tractogram.h index 6c5575a24a..9321d8171b 100644 --- a/src/gui/mrview/tool/tractography/tractogram.h +++ b/src/gui/mrview/tool/tractography/tractogram.h @@ -35,11 +35,6 @@ namespace MR namespace Tool { - - enum class TrackColourType { Direction, Ends, Manual, ScalarFile }; - enum class TrackGeometryType { Line, Pseudotubes, Points }; - enum class TrackThresholdType { None, UseColourFile, SeparateFile }; - class Tractogram : public Displayable { MEMALIGN(Tractogram) Q_OBJECT diff --git a/src/gui/mrview/tool/tractography/tractogram_enums.h b/src/gui/mrview/tool/tractography/tractogram_enums.h index 8de9c312dd..1aa47c7cb2 100644 --- a/src/gui/mrview/tool/tractography/tractogram_enums.h +++ b/src/gui/mrview/tool/tractography/tractogram_enums.h @@ -24,6 +24,7 @@ namespace MR namespace Tool { enum class TrackColourType { Direction, Ends, Manual, ScalarFile }; + enum class TrackGeometryType { Line, Pseudotubes, Points }; enum class TrackThresholdType { None, UseColourFile, SeparateFile }; } } From fa7bbc61196d9f6409720907c840b95bec4d3c15 Mon Sep 17 00:00:00 2001 From: Rami Tabbara Date: Thu, 17 Aug 2017 10:32:50 +1000 Subject: [PATCH 073/538] mrview: merge dev into tract_geom: Take 2 --- src/gui/mrview/tool/tractography/tractography.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/gui/mrview/tool/tractography/tractography.h b/src/gui/mrview/tool/tractography/tractography.h index f5ddd5fc9e..be4b72c8fa 100644 --- a/src/gui/mrview/tool/tractography/tractography.h +++ b/src/gui/mrview/tool/tractography/tractography.h @@ -109,9 +109,6 @@ namespace MR QGroupBox* lighting_group_box; QPushButton* lighting_button; - QGroupBox* lighting_group_box; - QPushButton* lighting_button; - QSlider* opacity_slider; QSlider* thickness_slider; @@ -124,8 +121,6 @@ namespace MR bool process_commandline_option_tsf_check_tracto_loaded (); bool process_commandline_option_tsf_option (const MR::App::ParsedOption&, uint, vector& range); void update_geometry_type_gui(); - - void update_geometry_type_gui(); }; } } From 996ed47253dd68b81a1b9ed7d9ea6228362721dd Mon Sep 17 00:00:00 2001 From: Rami Tabbara Date: Thu, 17 Aug 2017 10:56:17 +1000 Subject: [PATCH 074/538] mrview: Tract_geom: Setting pesudotubes as default * Also enabling lighting by default --- src/gui/mrview/tool/tractography/tractogram.cpp | 2 +- src/gui/mrview/tool/tractography/tractogram.h | 2 +- src/gui/mrview/tool/tractography/tractogram_enums.h | 2 +- src/gui/mrview/tool/tractography/tractography.cpp | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/gui/mrview/tool/tractography/tractogram.cpp b/src/gui/mrview/tool/tractography/tractogram.cpp index c3419377f2..391731c0f7 100644 --- a/src/gui/mrview/tool/tractography/tractogram.cpp +++ b/src/gui/mrview/tool/tractography/tractogram.cpp @@ -351,7 +351,7 @@ namespace MR filename (filename), color_type (TrackColourType::Direction), threshold_type (TrackThresholdType::None), - geometry_type (TrackGeometryType::Line), + geometry_type (TrackGeometryType::Pseudotubes), sample_stride (0), vao_dirty (true), threshold_min (NaN), diff --git a/src/gui/mrview/tool/tractography/tractogram.h b/src/gui/mrview/tool/tractography/tractogram.h index 9321d8171b..405d1dd668 100644 --- a/src/gui/mrview/tool/tractography/tractogram.h +++ b/src/gui/mrview/tool/tractography/tractogram.h @@ -98,7 +98,7 @@ namespace MR use_lighting (false), color_type (TrackColourType::Direction), threshold_type (TrackThresholdType::None), - geometry_type (TrackGeometryType::Line) { } + geometry_type (TrackGeometryType::Pseudotubes) { } std::string vertex_shader_source (const Displayable&) override; std::string fragment_shader_source (const Displayable&) override; std::string geometry_shader_source (const Displayable&) override; diff --git a/src/gui/mrview/tool/tractography/tractogram_enums.h b/src/gui/mrview/tool/tractography/tractogram_enums.h index 1aa47c7cb2..d3e0866111 100644 --- a/src/gui/mrview/tool/tractography/tractogram_enums.h +++ b/src/gui/mrview/tool/tractography/tractogram_enums.h @@ -24,7 +24,7 @@ namespace MR namespace Tool { enum class TrackColourType { Direction, Ends, Manual, ScalarFile }; - enum class TrackGeometryType { Line, Pseudotubes, Points }; + enum class TrackGeometryType { Pseudotubes, Lines , Points }; enum class TrackThresholdType { None, UseColourFile, SeparateFile }; } } diff --git a/src/gui/mrview/tool/tractography/tractography.cpp b/src/gui/mrview/tool/tractography/tractography.cpp index 3001a67f3c..874597ccc5 100644 --- a/src/gui/mrview/tool/tractography/tractography.cpp +++ b/src/gui/mrview/tool/tractography/tractography.cpp @@ -71,7 +71,7 @@ namespace MR line_thickness (MRTRIX_DEFAULT_LINE_THICKNESS), point_size (MRTRIX_DEFAULT_POINT_SIZE), do_crop_to_slab (true), - use_lighting (false), + use_lighting (true), not_3D (true), line_opacity (1.0), scalar_file_options (nullptr), @@ -169,8 +169,8 @@ namespace MR geom_type_combobox = new ComboBoxWithErrorMsg (this, "(variable)"); geom_type_combobox->setToolTip (tr ("Set the tractogram geometry type")); - geom_type_combobox->addItem ("Lines"); geom_type_combobox->addItem ("Pseudotubes"); + geom_type_combobox->addItem ("Lines"); geom_type_combobox->addItem ("Points"); connect (geom_type_combobox, SIGNAL (activated(int)), this, SLOT (geom_type_selection_slot (int))); hlayout->addWidget (geom_type_combobox); @@ -220,7 +220,7 @@ namespace MR lighting_group_box = new QGroupBox (tr("use lighting")); lighting_group_box->setCheckable (true); - lighting_group_box->setChecked (false); + lighting_group_box->setChecked (true); general_opt_grid->addWidget (lighting_group_box, 5, 0, 1, 2); connect (lighting_group_box, SIGNAL (clicked (bool)), this, SLOT (on_use_lighting_slot (bool))); @@ -634,11 +634,11 @@ namespace MR void Tractography::geom_type_selection_slot(int selected_index) { - TrackGeometryType geom_type = TrackGeometryType::Line; + TrackGeometryType geom_type = TrackGeometryType::Pseudotubes; switch (selected_index) { case 1: - geom_type = TrackGeometryType::Pseudotubes; + geom_type = TrackGeometryType::Lines; break; case 2: geom_type = TrackGeometryType::Points; @@ -712,7 +712,7 @@ namespace MR TrackGeometryType geom_type = first_tractogram->get_geometry_type(); int geom_combobox_index = 0; switch (geom_type) { - case TrackGeometryType::Pseudotubes: + case TrackGeometryType::Lines: geom_combobox_index = 1; break; case TrackGeometryType::Points: From ab8b7ad045bfcc859de8f198b2ca34c5bdd4bcb1 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 18 Aug 2017 11:30:43 +1000 Subject: [PATCH 075/538] Scripts: Further changes to app and image modules - app: Reworked debug() function slightly to use frame-based inspect functions rather than the stack. Added var() function for querying (at debug level verbosity) the value of one or more variables, similarly to the C++ VAR() macro. image: Changed back to a Header class for importing image header entries. However the entries are stored as private members and accessed using public read-only functions. --- bin/dwi2response | 5 +- bin/dwibiascorrect | 12 ++-- bin/dwigradcheck | 2 +- bin/dwipreproc | 22 +++--- bin/population_template | 2 +- lib/mrtrix3/app.py | 67 ++++++++++++----- lib/mrtrix3/image.py | 135 ++++++++++++++++++----------------- lib/mrtrix3/phaseEncoding.py | 4 +- 8 files changed, 140 insertions(+), 109 deletions(-) diff --git a/bin/dwi2response b/bin/dwi2response index 4ac013eed7..201e65f16e 100755 --- a/bin/dwi2response +++ b/bin/dwi2response @@ -74,7 +74,7 @@ if app.args.grad: grad_import_option = ' -grad ' + path.fromUser(app.args.grad, True) elif app.args.fslgrad: grad_import_option = ' -fslgrad ' + path.fromUser(app.args.fslgrad[0], True) + ' ' + path.fromUser(app.args.fslgrad[1], True) -elif 'dw_scheme' not in image.header(path.fromUser(app.args.input, False)).keyval: +elif 'dw_scheme' not in image.Header(path.fromUser(app.args.input, False)).keyval(): app.error('Script requires diffusion gradient table: either in image header, or using -grad / -fslgrad option') app.makeTempDir() @@ -95,13 +95,12 @@ app.gotoTempDir() # Check that the brain mask is appropriate -if image.header('mask.mif').size[:3] != image.header('dwi.mif').size[:3]: +if image.Header('mask.mif').size()[:3] != image.Header('dwi.mif').size()[:3]: app.error('Dimensions of provided mask image do not match DWI') if int(image.statistic('mask.mif', 'count', '-mask mask.mif')) == 0: app.error('Input mask does not contain any voxels') - # From here, the script splits depending on what estimation algorithm is being used alg.execute() diff --git a/bin/dwibiascorrect b/bin/dwibiascorrect index b9767ddcec..bccdfeefe7 100755 --- a/bin/dwibiascorrect +++ b/bin/dwibiascorrect @@ -70,17 +70,17 @@ if app.args.mask: app.gotoTempDir() # Make sure it's actually a DWI that's been passed -dwi_header = image.header('in.mif') -if len(dwi_header.size) != 4: +dwi_header = image.Header('in.mif') +if len(dwi_header.size()) != 4: app.error('Input image must be a 4D image') -if 'dw_scheme' not in dwi_header.keyval: +if 'dw_scheme' not in dwi_header.keyval(): app.error('No valid DW gradient scheme provided or present in image header') -if len(dwi_header.keyval['dw_scheme']) != dwi_header.size[3]: - app.error('DW gradient scheme contains different number of entries (' + str(len(dwi_header.keyval['dw_scheme'])) + ' to number of volumes in DWIs (' + dwi_header.size[3] + ')') +if len(dwi_header.keyval()['dw_scheme']) != dwi_header.size()[3]: + app.error('DW gradient scheme contains different number of entries (' + str(len(dwi_header.keyval()['dw_scheme'])) + ' to number of volumes in DWIs (' + dwi_header.size()[3] + ')') # Generate a brain mask if required, or check the mask if provided if app.args.mask: - if image.header('mask.mif').size[:3] != dwi_header.size[:3]: + if image.Header('mask.mif').size()[:3] != dwi_header.size()[:3]: app.error('Provided mask image does not match input DWI') else: run.command('dwi2mask in.mif mask.mif') diff --git a/bin/dwigradcheck b/bin/dwigradcheck index 96f724471f..e0595b0d71 100755 --- a/bin/dwigradcheck +++ b/bin/dwigradcheck @@ -33,7 +33,7 @@ app.cmdline.flagMutuallyExclusiveOptions( ['grad', 'fslgrad' ]) app.cmdline.flagMutuallyExclusiveOptions( ['export_grad_mrtrix', 'export_grad_fsl' ]) app.parse() -image_dimensions = image.header(path.fromUser(app.args.input, False)).size +image_dimensions = image.Header(path.fromUser(app.args.input, False)).size() if len(image_dimensions) != 4: app.error('Input image must be a 4D image') if min(image_dimensions) == 1: diff --git a/bin/dwipreproc b/bin/dwipreproc index 05b07da7da..031bcbe31e 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -129,19 +129,19 @@ app.gotoTempDir() # Get information on the input images, and check their validity -dwi_header = image.header('dwi.mif') -if not len(dwi_header.size) == 4: +dwi_header = image.Header('dwi.mif') +if not len(dwi_header.size()) == 4: app.error('Input DWI must be a 4D image') -num_volumes = dwi_header.size[3] +num_volumes = dwi_header.size()[3] dwi_pe_scheme = phaseEncoding.getScheme('dwi.mif') if app.args.se_epi: - se_epi_header = image.header('se_epi.mif') - if not len(se_epi_header.size) == 4: + se_epi_header = image.Header('se_epi.mif') + if not len(se_epi_header.size()) == 4: app.error('File provided using -se_epi option must contain more than one image volume') topup_pe_scheme = phaseEncoding.getScheme('se_epi.mif') -if 'dw_scheme' not in dwi_header.keyval: +if 'dw_scheme' not in dwi_header.keyval(): app.error('No diffusion gradient table found') -grad = dwi_header.keyval['dw_scheme'] +grad = dwi_header.keyval()['dw_scheme'] if not len(grad) == num_volumes: app.error('Number of lines in gradient table (' + str(len(grad)) + ') does not match input image (' + str(num_volumes) + ' volumes); check your input data') @@ -206,7 +206,7 @@ if manual_pe_dir: line = list(manual_pe_dir) line.append(trt) dwi_manual_pe_scheme = [ line ] * num_volumes - num_topup_volumes = se_epi_header.size[3] + num_topup_volumes = se_epi_header.size()[3] if num_topup_volumes%2: app.error('If using -rpe_pair option, image provided using -se_epi must contain an even number of volumes') # Assume that first half of volumes have same direction as series; @@ -379,12 +379,12 @@ elif not PE_design == 'None': # No SE EPI images explicitly provided: In some ca # With -rpe_all, need to write inferred phase-encoding to file and import before using dwiextract so that the phase-encoding # of the extracted b=0's is propagated to the generated b=0 series run.command('mrconvert dwi.mif' + import_dwi_pe_table_option + ' - | dwiextract - se_epi.mif -bzero') - se_epi_header = image.header('se_epi.mif') + se_epi_header = image.Header('se_epi.mif') # If there's no contrast remaining in the phase-encoding scheme, it'll be written to # PhaseEncodingDirection and TotalReadoutTime rather than pe_scheme # In this scenario, we will be unable to run topup, or volume recombination - if 'pe_scheme' not in se_epi_header.keyval: + if 'pe_scheme' not in se_epi_header.keyval(): if PE_design == 'All': app.error('DWI header indicates no phase encoding contrast between b=0 images; cannot proceed with volume recombination-based pre-processing') else: @@ -494,7 +494,7 @@ run.command(eddy_cmd + ' --imain=dwi.nii --mask=mask.nii --acqp=eddy_config.txt # Get the axis strides from the input series, so the output image can be modified to match -stride_option = ' -stride ' + ','.join([str(i) for i in dwi_header.stride]) +stride_option = ' -stride ' + ','.join([str(i) for i in dwi_header.stride()]) diff --git a/bin/population_template b/bin/population_template index c7e83b9dc6..822b822cfd 100755 --- a/bin/population_template +++ b/bin/population_template @@ -307,7 +307,7 @@ if app.args.linear_transformations_dir: # automatically detect SH series do_fod_registration = False -image_size = image.header(relpath(inputs[0].directory, inputs[0].filename)).size +image_size = image.Header(relpath(inputs[0].directory, inputs[0].filename)).size() if len(image_size) < 3 or len(image_size) > 4: app.error('only 3 and 4 dimensional images can be used to build a template') if len(image_size) == 4: diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index c30515db09..13b593277d 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -283,24 +283,32 @@ def debug(text): #pylint: disable=unused-variable global verbosity if verbosity <= 2: return - if len(inspect.stack()) == 2: # debug() called directly from script being executed - caller = inspect.getframeinfo(inspect.stack()[1][0]) - origin = '(' + os.path.basename(caller.filename) + ':' + str(caller.lineno) + ')' - else: # Some function has called debug(): Get location of both that function, and where that function was invoked - stack = inspect.stack()[1] - try: - filename = stack.filename - fname = stack.function - except: # Prior to Version 3.5 - filename = stack[1] - fname = stack[3] - funcname = fname + '()' - modulename = inspect.getmodulename(filename) - if modulename: - funcname = modulename + '.' + funcname - caller = inspect.getframeinfo(inspect.stack()[2][0]) - origin = funcname + ' (from ' + os.path.basename(caller.filename) + ':' + str(caller.lineno) + ')' - sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + colourDebug + '[DEBUG] ' + origin + ': ' + text + colourClear + '\n') + outer_frames = inspect.getouterframes(inspect.currentframe()) + nearest = outer_frames[1] + try: + if len(outer_frames) == 2: # debug() called directly from script being executed + origin = '(' + os.path.basename(nearest.filename) + ':' + str(nearest.lineno) + ')' + else: # Some function has called debug(): Get location of both that function, and where that function was invoked + try: + filename = nearest.filename + funcname = nearest.function + '()' + except: # Prior to Python 3.5 + filename = nearest[1] + funcname = nearest[3] + '()' + modulename = inspect.getmodulename(filename) + if modulename: + funcname = modulename + '.' + funcname + origin = funcname + caller = outer_frames[2] + try: + origin += ' (from ' + os.path.basename(caller.filename) + ':' + str(caller.lineno) + ')' + except: # Prior to Python 3.5 + origin += ' (from ' + os.path.basename(caller[1]) + ':' + str(caller[3]) + ')' + finally: + del caller + sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + colourDebug + '[DEBUG] ' + origin + ': ' + text + colourClear + '\n') + finally: + del nearest def error(text): #pylint: disable=unused-variable import os, sys @@ -311,6 +319,29 @@ def error(text): #pylint: disable=unused-variable complete() sys.exit(1) +def var(*variables): #pylint: disable=unused-variable + import inspect, os, sys + global colourClear, colourDebug + global verbosity + if verbosity <= 2: + return + calling_frame = inspect.getouterframes(inspect.currentframe())[1] + try: + try: + calling_code = calling_frame.code_context[0] + filename = calling_frame.filename + lineno = calling_frame.lineno + except: # Prior to Python 3.5 + calling_code = calling_frame[4][0] + filename = calling_frame[1] + lineno = calling_frame[2] + var_string = calling_code[calling_code.find('var(')+4:].rstrip('\n').rstrip(' ')[:-1].replace(',', ' ') + var_names, var_values = var_string.split(), variables + for name, value in zip(var_names, var_values): + sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + colourDebug + '[DEBUG] (from ' + os.path.basename(filename) + ':' + str(lineno) + ') \'' + name + '\' = ' + str(value) + colourClear + '\n') + finally: + del calling_frame + def warn(text): #pylint: disable=unused-variable import os, sys global colourClear, colourWarn diff --git a/lib/mrtrix3/image.py b/lib/mrtrix3/image.py index 9dc9a7286c..aec419627c 100644 --- a/lib/mrtrix3/image.py +++ b/lib/mrtrix3/image.py @@ -3,12 +3,74 @@ # data, rather than trying to duplicate support for all possible image formats natively # in Python. +# Class for importing header information from an image file for reading +class Header: + def __init__(self, image_path): + import json, os, subprocess + from mrtrix3 import app, path, run + filename = path.newTemporary('json') + command = [ run.exeName(run.versionMatch('mrinfo')), image_path, '-json_all', filename ] + if app.verbosity > 1: + app.console('Loading header for image file \'' + image_path + '\'') + app.debug(str(command)) + result = subprocess.call(command, stdout=None, stderr=None) + if result: + app.error('Could not access header information for image \'' + image_path + '\'') + with open(filename, 'r') as f: + data = json.load(f) + os.remove(filename) + try: + #self.__dict__.update(data) + # Load the individual header elements manually, for a couple of reasons: + # - So that pylint knows that they'll be there + # - Write to private members, and give read-only access + self._name = data['name'] + self._size = data['size'] + self._spacing = data['spacing'] + self._stride = data['stride'] + self._format = data['format'] + self._datatype = data['datatype'] + self._intensity_offset = data['intensity_offset'] + self._intensity_scale = data['intensity_scale'] + self._transform = data['transform'] + if not 'keyval' in data or not data['keyval']: + self._keyval = { } + else: + self._keyval = data['keyval'] + except: + app.error('Error in reading header information from file \'' + image_path + '\'') + app.debug(str(vars(self))) + + def name(self): + return self._name + def size(self): + return self._size + def spacing(self): + return self._spacing + def stride(self): + return self._stride + def format(self): + return self._format + def datatype(self): + return self.datatype + def intensity_offset(self): + return self._intensity_offset + def intensity_scale(self): + return self._intensity_scale + def keyval(self): + return self._keyval + + + +# Determine whether or not an image contains at least three axes, the first three of which +# have dimension greater than one: This means that the data can plausibly represent +# spatial information, and 3D interpolation can be performed def check3DNonunity(image_in): #pylint: disable=unused-variable from mrtrix3 import app - if not isHeader(image_in): + if not isinstance(image_in, Header): if not isinstance(image_in, str): app.error('Error trying to test \'' + str(image_in) + '\': Not an image header or file path') - image_in = header(image_in) + image_in = Header(image_in) if len(image_in.size) < 3: app.error('Image \'' + image_in.name + '\' does not contain 3 spatial dimensions') if min(image_in.size[:3]) == 1: @@ -17,67 +79,6 @@ def check3DNonunity(image_in): #pylint: disable=unused-variable -# Function to grab all contents of an image header -# Uses mrinfo's new -json_all option in order to grab all header information -# from any image format supported by MRtrix3's C++ libraries -def header(image_path): - import json, os, subprocess - from mrtrix3 import app, path, run - filename = path.newTemporary('json') - command = [ run.exeName(run.versionMatch('mrinfo')), image_path, '-json_all', filename ] - if app.verbosity > 1: - app.console('Loading header for image file \'' + image_path + '\'') - app.debug(str(command)) - result = subprocess.call(command, stdout=None, stderr=None) - if result: - app.error('Could not access header information for image \'' + image_path + '\'') - with open(filename, 'r') as f: - elements = json.load(f) - - class _Header: - def __init__(self, data): - #self.__dict__.update(data) - # Load the individual header elements manually, so that pylint knows that they'll be there - self.name = data['name'] - self.size = data['size'] - self.spacing = data['spacing'] - self.stride = data['stride'] - self.format = data['format'] - self.datatype = data['datatype'] - self.intensity_offset = data['intensity_offset'] - self.intensity_scale = data['intensity_scale'] - self.transform = data['transform'] - if not 'keyval' in data or not data['keyval']: - self.keyval = { } - else: - self.keyval = data['keyval'] - - try: - result = _Header(elements) - except: - app.error('Error in reading header information from file \'' + image_path + '\'') - os.remove(filename) - app.debug(str(vars(result))) - return result - - - -# Function to test whether or not a Python object contains those flags expected -# within an image header -def isHeader(obj): - from mrtrix3 import app - try: - #pylint: disable=pointless-statement,too-many-boolean-expressions - obj.name and obj.size and obj.spacing and obj.stride and obj.format and obj.datatype \ - and obj.intensity_offset and obj.intensity_scale and obj.transform and obj.keyval - app.debug('\'' + str(obj) + '\' IS a header object') - return True - except: - app.debug('\'' + str(obj) + '\' is NOT a header object') - return False - - - # Despite being able to import the entire image header contents using the header() # function, there are still some functionalities in mrinfo that can prove useful. # Therefore, provide this function to execute mrinfo and get just the information of @@ -103,14 +104,14 @@ def mrinfo(image_path, field): #pylint: disable=unused-variable def match(image_one, image_two): #pylint: disable=unused-variable import math from mrtrix3 import app - if not isHeader(image_one): + if not isinstance(image_one, Header): if not isinstance(image_one, str): app.error('Error trying to test \'' + str(image_one) + '\': Not an image header or file path') - image_one = header(image_one) - if not isHeader(image_two): + image_one = Header(image_one) + if not isinstance(image_two, Header): if not isinstance(image_two, str): app.error('Error trying to test \'' + str(image_two) + '\': Not an image header or file path') - image_two = header(image_two) + image_two = Header(image_two) debug_prefix = '\'' + image_one.name + '\' \'' + image_two.name + '\'' # Image dimensions if image_one.size != image_two.size: diff --git a/lib/mrtrix3/phaseEncoding.py b/lib/mrtrix3/phaseEncoding.py index 52b67aa015..260b497cbe 100644 --- a/lib/mrtrix3/phaseEncoding.py +++ b/lib/mrtrix3/phaseEncoding.py @@ -51,10 +51,10 @@ def direction(string): #pylint: disable=unused-variable # or from a path to the image def getScheme(arg): #pylint: disable=unused-variable from mrtrix3 import app, image - if not image.isHeader(arg): + if not isinstance(arg, image.Header): if not isinstance(arg, str): app.error('Error trying to derive phase-encoding scheme from \'' + str(arg) + '\': Not an image header or file path') - arg = image.header(arg) + arg = image.Header(arg) if 'pe_scheme' in arg.keyval: app.debug(arg.keyval['pe_scheme']) return arg.keyval['pe_scheme'] From 9cb82043e41b81f57aaa88e9c489849406808204 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 18 Aug 2017 12:27:24 +1000 Subject: [PATCH 076/538] convert_bruker: Move pylint bypasses to apply to individual lines --- bin/convert_bruker | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/bin/convert_bruker b/bin/convert_bruker index 9c2a60d212..82f116641e 100755 --- a/bin/convert_bruker +++ b/bin/convert_bruker @@ -62,15 +62,13 @@ with open (sys.argv[2], 'w') as f: f.write (',' + str(mat_size[2])) else: try: - #pylint: disable=pointless-statement - nslices + nslices #pylint: disable=pointless-statement f.write (',' + str(nslices)) except: pass try: - #pylint: disable=pointless-statement - nacq + nacq #pylint: disable=pointless-statement f.write (',' + str(nacq)) except: pass @@ -80,14 +78,12 @@ with open (sys.argv[2], 'w') as f: f.write (',' + str(res[2])) else: try: - #pylint: disable=pointless-statement - slicethick + slicethick #pylint: disable=pointless-statement f.write (',' + str(slicethick)) except: pass try: - #pylint: disable=pointless-statement - nacq + nacq #pylint: disable=pointless-statement f.write (',') except: pass @@ -105,14 +101,12 @@ with open (sys.argv[2], 'w') as f: f.write ('\nlayout: +0,+1') try: - #pylint: disable=pointless-statement - nslices + nslices #pylint: disable=pointless-statement f.write (',+2') except: pass try: - #pylint: disable=pointless-statement - nacq + nacq #pylint: disable=pointless-statement f.write (',+3') except: pass @@ -122,7 +116,6 @@ with open (sys.argv[2], 'w') as f: try: #pylint: disable=pointless-statement bvec - #pylint: disable=pointless-statement bval for n in range (0, len (bval)): f.write ('dw_scheme: ' + bvec[3*n] + ',' + bvec[3*n+1] + ',' + str(-float(bvec[3*n+2])) + ',' + bval[n] + '\n') From 07882b6f8c0f2613d2c70f8f498dddb557954cc6 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 18 Aug 2017 14:53:31 +1000 Subject: [PATCH 077/538] Changes to pass run_pylint in Python2 - Execute run_pylint script after build script is completed, since it is responsible for creating the _version.py file. - Replace all instances of print() with sys.stdout.write(), since pylint in Python2 complains about presence of parentheses whereas Python3 complains about their absence. - average_response: More Pythonic construction of zero-filled average response matrix. - Disable redefined-builtin when importing mrtrix3.file; although I can't find anything about such a builtin, and can't even seem to import it, Python2 nevertheless complains; but it would be better to retain that test globally. - Explicitly use new-style classes that inherit from 'object'. - Cleaner comprehension in mrtrix3.run.command() for splitting based on pipe symbol. --- .travis.yml | 6 +- bin/average_response | 16 +-- bin/blend | 6 +- bin/convert_bruker | 4 +- bin/dwigradcheck | 4 +- bin/dwiintensitynorm | 4 +- bin/dwipreproc | 2 +- bin/population_template | 16 +-- lib/mrtrix3/_5ttgen/fsl.py | 2 +- lib/mrtrix3/app.py | 154 +++++++++++---------------- lib/mrtrix3/dwi2response/tax.py | 2 +- lib/mrtrix3/dwi2response/tournier.py | 2 +- lib/mrtrix3/fsl.py | 28 ++--- lib/mrtrix3/image.py | 2 +- lib/mrtrix3/run.py | 4 +- 15 files changed, 112 insertions(+), 140 deletions(-) diff --git a/.travis.yml b/.travis.yml index 10511ff80b..1bfd9eb852 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ compiler: env: - py=python2 - py=python3 -install: +install: - export NUMBER_OF_PROCESSORS=4 - export PATH=`pwd`/bin:${PATH} - export PYTHONPATH=`pwd`/lib:${PYTHONPATH} @@ -25,9 +25,9 @@ install: - pip install pylint - pip3 install pylint script: - - ./check_memalign && $py ./configure -assert && PYTHON=$py ./run_pylint && $py ./build -nowarnings && ./run_tests + - ./check_memalign && $py ./configure -assert && $py ./build -nowarnings && PYTHON=$py ./run_pylint && ./run_tests -after_failure: +after_failure: - cat memalign.log - cat configure.log - cat pylint.log diff --git a/bin/average_response b/bin/average_response index a6dd04befe..10e455a867 100755 --- a/bin/average_response +++ b/bin/average_response @@ -2,17 +2,17 @@ import sys def errorMessage(msg): - print (msg) + sys.stderr.write(msg + '\n') exit(1) if len(sys.argv) < 3 : - print("example usage: average_response input_response1.txt input_response2.txt input_response3.txt ... output_average_response.txt") + sys.stderr.write("example usage: average_response input_response1.txt input_response2.txt input_response3.txt ... output_average_response.txt\n") exit(1) num_bvals = 0 num_coeff = 0 num_subjects = len(sys.argv) - 2 -print ("Number of subjects: " + str(num_subjects)) +sys.stdout.write("Number of subjects: " + str(num_subjects) + '\n') for i in range(1, num_subjects + 1): with open(sys.argv[i], 'r') as f: @@ -22,17 +22,17 @@ for i in range(1, num_subjects + 1): num_coeff = len(lines[0].split()) for l in lines: if len(l.split()) != num_coeff: - errorMessage ("Error in file " + sys.argv[i] + ": multi-shell response functions must have the same number of coefficients per b-value (line)") + errorMessage("Error in file " + sys.argv[i] + ": multi-shell response functions must have the same number of coefficients per b-value (line)") else: if len(lines) != num_bvals: - errorMessage ("Error in file " + sys.argv[i] + ": Input files do not contain the same number of b-values") + errorMessage("Error in file " + sys.argv[i] + ": Input files do not contain the same number of b-values") for l in lines: if len(l.split()) != num_coeff: - errorMessage ("Error in file " + sys.argv[i] + ": multi-shell response functions must have the same number of coefficients per b-value (line)") + errorMessage("Error in file " + sys.argv[i] + ": multi-shell response functions must have the same number of coefficients per b-value (line)") -print ("Number of b-values: " + str(num_bvals)) +sys.stdout.write("Number of b-values: " + str(num_bvals) + '\n') -average_response = [[0 for x in range(num_coeff)] for y in range(num_bvals)] +average_response = [[0] * num_coeff] * num_bvals for i in range(1, num_subjects + 1): with open(sys.argv[i], 'r') as f: lines = f.readlines() diff --git a/bin/blend b/bin/blend index 519b1e7fa8..5e4b41bcc9 100755 --- a/bin/blend +++ b/bin/blend @@ -3,9 +3,9 @@ import os import sys if len(sys.argv) <= 1: - print ('A script to blend two sets of movie frames together with a desired overlap.') - print ('The input arguments are two folders containing the movie frames (eg. output from the MRview screenshot tool), and the desired number of overlapping frames.') - print ('eg: blend folder1 folder2 20 output_folder') + sys.stderr.write('A script to blend two sets of movie frames together with a desired overlap.\n') + sys.stderr.write('The input arguments are two folders containing the movie frames (eg. output from the MRview screenshot tool), and the desired number of overlapping frames.\n') + sys.stderr.write('eg: blend folder1 folder2 20 output_folder\n') sys.exit(1) input_folder1 = sys.argv[1] diff --git a/bin/convert_bruker b/bin/convert_bruker index 82f116641e..e789e5adcc 100755 --- a/bin/convert_bruker +++ b/bin/convert_bruker @@ -3,7 +3,7 @@ import sys, os.path if len (sys.argv) != 3: - print ("usage: convert_bruker 2dseq header.mih") + sys.stderr.write("usage: convert_bruker 2dseq header.mih\n") sys.exit (0) @@ -12,7 +12,7 @@ if len (sys.argv) != 3: #sys.exit (1) if not sys.argv[2].endswith ('.mih'): - print ("expected .mih suffix as the second argument") + sys.stderr.write("expected .mih suffix as the second argument\n") sys.exit (1) with open (os.path.join (os.path.dirname (sys.argv[1]), 'reco')) as f: diff --git a/bin/dwigradcheck b/bin/dwigradcheck index e0595b0d71..cbb6ae32a2 100755 --- a/bin/dwigradcheck +++ b/bin/dwigradcheck @@ -178,13 +178,13 @@ lengths.reverse() # Provide a printout of the mean streamline length of each gradient table manipulation -print ('Mean length Axis flipped Axis permutations Axis basis') +sys.stderr.write('Mean length Axis flipped Axis permutations Axis basis\n') for line in lengths: if isinstance(line[1], numbers.Number): flip_str = "{:4d}".format(line[1]) else: flip_str = line[1] - print ("{:5.2f}".format(line[0]) + ' ' + flip_str + ' ' + str(line[2]) + ' ' + line[3]) + sys.stderr.write("{:5.2f}".format(line[0]) + ' ' + flip_str + ' ' + str(line[2]) + ' ' + line[3] + '\n') # If requested, extract what has been detected as the best gradient table, and diff --git a/bin/dwiintensitynorm b/bin/dwiintensitynorm index 36433b3650..777efad61a 100755 --- a/bin/dwiintensitynorm +++ b/bin/dwiintensitynorm @@ -10,7 +10,7 @@ if not os.path.isdir(lib_folder): sys.path.insert(0, lib_folder) -from mrtrix3 import app, file, image, path, run +from mrtrix3 import app, file, image, path, run #pylint: disable=redefined-builtin def abspath(*arg): @@ -21,7 +21,7 @@ def relpath(*arg): -class Input: +class Input(object): def __init__(self, filename, prefix, directory, mask_filename = '', mask_directory = ''): self.filename = filename self.prefix = prefix diff --git a/bin/dwipreproc b/bin/dwipreproc index 031bcbe31e..9b685c1b74 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -23,7 +23,7 @@ if not os.path.isdir(lib_folder): sys.path.insert(0, lib_folder) import math -from mrtrix3 import app, file, fsl, image, path, phaseEncoding, run +from mrtrix3 import app, file, fsl, image, path, phaseEncoding, run #pylint: disable=redefined-builtin app.init ('Robert E. Smith (robert.smith@florey.edu.au)', diff --git a/bin/population_template b/bin/population_template index 822b822cfd..4efcfb1a02 100755 --- a/bin/population_template +++ b/bin/population_template @@ -28,7 +28,7 @@ except NameError: import math -from mrtrix3 import app, file, image, path, run +from mrtrix3 import app, file, image, path, run #pylint: disable=redefined-builtin @@ -39,7 +39,7 @@ def relpath(*arg): return os.path.relpath(os.path.join(*arg), app.workingDir) def allindir(directory): - return ' '.join( [ os.path.join(directory, file) for file in os.listdir(directory) ] ) + return ' '.join( [ os.path.join(directory, filename) for filename in os.listdir(directory) ] ) @@ -49,7 +49,7 @@ except ImportError: app.console("numpy not found; using replacement functions") def loadtxt(fname, delimiter=" ", dtype=float): with open(fname, "r") as f: - return [[dtype(x) for x in l.rstrip().split(delimiter)] for l in f.readlines()] + return [[dtype(a) for a in l.rstrip().split(delimiter)] for l in f.readlines()] def savetxt(fname, X, delimiter=" ", fmt="%.14e"): try: @@ -95,12 +95,12 @@ def check_linear_transformation (transformation, cmd, max_scaling = 0.5, max_she return True data = load_key_value(transformation + 'decomp') run.function(remove, transformation + 'decomp') - scaling = [float(x) for x in data['scaling']] - if any([x < 0 for x in scaling]) or any([x > (1 + max_scaling) for x in scaling]) or any([x < (1 - max_scaling) for x in scaling]): + scaling = [float(value) for value in data['scaling']] + if any([a < 0 for a in scaling]) or any([a > (1 + max_scaling) for a in scaling]) or any([a < (1 - max_scaling) for a in scaling]): app.warn ("large scaling (" + str(scaling) + ") in " + transformation) bGood = False - shear = [float(x) for x in data['shear']] - if any([abs(x) > max_shear for x in shear]): + shear = [float(value) for value in data['shear']] + if any([abs(a) > max_shear for a in shear]): app.warn ("large shear (" + str(shear) + ") in " + transformation) bGood = False rot_angle = float(data['angle_axis'][0]) @@ -146,7 +146,7 @@ def check_linear_transformation (transformation, cmd, max_scaling = 0.5, max_she input("press enter to continue population_template") return bGood -class Input: +class Input(object): def __init__(self, filename, prefix, directory, mask_filename = '', mask_directory = ''): self.filename = filename self.prefix = prefix diff --git a/lib/mrtrix3/_5ttgen/fsl.py b/lib/mrtrix3/_5ttgen/fsl.py index 5402205152..523410632e 100644 --- a/lib/mrtrix3/_5ttgen/fsl.py +++ b/lib/mrtrix3/_5ttgen/fsl.py @@ -35,7 +35,7 @@ def getInputs(): #pylint: disable=unused-variable def execute(): #pylint: disable=unused-variable import os - from mrtrix3 import app, file, fsl, image, path, run + from mrtrix3 import app, file, fsl, image, path, run #pylint: disable=redefined-builtin if app.isWindows(): app.error('\'fsl\' algorithm of 5ttgen script cannot be run on Windows: FSL not available on Windows') diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index 13b593277d..08a2c09ae8 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -511,7 +511,7 @@ def formatUsage(self): return self.prog + ' ' + ' '.join(argument_list) + ' [ options ]' + trailing_ellipsis def printHelp(self): - import subprocess, textwrap + import subprocess, sys, textwrap def bold(text): return ''.join( c + chr(0x08) + c for c in text) @@ -628,19 +628,19 @@ def appVersion(): process = subprocess.Popen(command.split(' '), stdin=subprocess.PIPE) process.communicate(s.encode()) except: - print (s) + sys.stdout.write(s) else: - print (s) + sys.stdout.write(s) def printFullUsage(self): import sys - print (self.synopsis) + sys.stdout.write(self.synopsis + '\n') if self._description: if isinstance(self._description, list): for line in self._description: - print (line) + sys.stdout.write(line + '\n') else: - print (self._description) + sys.stdout.write(self._description + '\n') if self._subparsers and len(sys.argv) == 3: for alg in self._subparsers._group_actions[0].choices: if alg == sys.argv[1]: @@ -649,19 +649,19 @@ def printFullUsage(self): self.error('Invalid subparser nominated') for arg in self._positionals._group_actions: # This will need updating if any scripts allow mulitple argument inputs - print ('ARGUMENT ' + arg.dest + ' 0 0') - print (arg.help) + sys.stdout.write('ARGUMENT ' + arg.dest + ' 0 0\n') + sys.stdout.write(arg.help + '\n') for group in reversed(self._action_groups): if group._group_actions and not (len(group._group_actions) == 1 and isinstance(group._group_actions[0], argparse._SubParsersAction)) and not group == self._positionals: for option in group._group_actions: - print ('OPTION ' + '/'.join(option.option_strings) + ' 1 0') - print (option.help) + sys.stdout.write('OPTION ' + '/'.join(option.option_strings) + ' 1 0\n') + sys.stdout.write(option.help + '\n') if option.metavar: if isinstance(option.metavar, tuple): for arg in option.metavar: - print ('ARGUMENT ' + arg + ' 0 0') + sys.stdout.write('ARGUMENT ' + arg + ' 0 0\n') else: - print ('ARGUMENT ' + option.metavar + ' 0 0') + sys.stdout.write('ARGUMENT ' + option.metavar + ' 0 0\n') def printUsageMarkdown(self): import os, subprocess, sys @@ -671,35 +671,26 @@ def printUsageMarkdown(self): self._subparsers._group_actions[0].choices[alg].printUsageMarkdown() return self.error('Invalid subcmdline nominated') - print ('## Synopsis') - print ('') - print (self.synopsis) - print ('') - print ('## Usage') - print ('') - print (' ' + self.formatUsage()) - print ('') + s = '## Synopsis\n\n' + s += self.synopsis + '\n\n' + s += '## Usage\n\n' + s += ' ' + self.formatUsage() + '\n\n' if self._subparsers: - print ('- *' + self._subparsers._group_actions[0].dest + '*: ' + self._subparsers._group_actions[0].help) + s += '- *' + self._subparsers._group_actions[0].dest + '*: ' + self._subparsers._group_actions[0].help + '\n' for arg in self._positionals._group_actions: if arg.metavar: name = arg.metavar else: name = arg.dest - print ('- *' + name + '*: ' + arg.help) - print ('') + s += '- *' + name + '*: ' + arg.help + '\n\n' if self._description: - print ('## Description') - print ('') + s += '## Description\n\n' for line in self._description: - print (line) - print ('') - print ('## Options') - print ('') + s += line + '\n\n' + s += '## Options\n\n' for group in reversed(self._action_groups): if group._group_actions and not (len(group._group_actions) == 1 and isinstance(group._group_actions[0], argparse._SubParsersAction)) and not group == self._positionals: - print ('#### ' + group.title) - print ('') + s += '#### ' + group.title + '\n\n' for option in group._group_actions: text = '/'.join(option.option_strings) if option.metavar: @@ -708,25 +699,21 @@ def printUsageMarkdown(self): text += ' '.join(option.metavar) else: text += option.metavar - print ('+ **-' + text + '**
' + option.help) - print ('') + s += '+ **-' + text + '**
' + option.help + '\n\n' if self.citationList: - print ('## References') - print ('') + s += '## References\n\n' for ref in self.citationList: text = '' if ref[0]: text += ref[0] + ': ' text += ref[1] - print (text) - print ('') - print ('---') - print ('') - print ('**Author:** ' + self._author) - print ('') - print ('**Copyright:** ' + self._copyright) - print ('') + s += text + '\n\n' + s += '---\n\n' + s += '**Author:** ' + self._author + '\n\n' + s += '**Copyright:** ' + self._copyright + '\n\n' + sys.stdout.write(s) if self._subparsers: + sys.stdout.flush() for alg in self._subparsers._group_actions[0].choices: subprocess.call ([ sys.executable, os.path.realpath(sys.argv[0]), alg, '__print_usage_markdown__' ]) @@ -739,46 +726,37 @@ def printUsageRst(self): self._subparsers._group_actions[0].choices[alg].printUsageRst() return self.error('Invalid subparser nominated: ' + sys.argv[-2]) - print ('.. _' + self.prog.replace(' ', '_') + ':') - print ('') - print (self.prog) - print ('='*len(self.prog)) - print ('') - print ('Synopsis') - print ('--------') - print ('') - print (self.synopsis) - print ('') - print ('Usage') - print ('--------') - print ('') - print ('::') - print ('') - print (' ' + self.formatUsage()) - print ('') + s = '.. _' + self.prog.replace(' ', '_') + ':\n\n' + s += self.prog + '\n' + s += '='*len(self.prog) + '\n\n' + s += 'Synopsis\n' + s += '--------\n\n' + s += self.synopsis + '\n\n' + s += 'Usage\n' + s += '--------\n\n' + s += '::\n\n' + s += ' ' + self.formatUsage() + '\n\n' if self._subparsers: - print ('- *' + self._subparsers._group_actions[0].dest + '*: ' + self._subparsers._group_actions[0].help) + s += '- *' + self._subparsers._group_actions[0].dest + '*: ' + self._subparsers._group_actions[0].help + '\n' for arg in self._positionals._group_actions: if arg.metavar: name = arg.metavar else: name = arg.dest - print ('- *' + name + '*: ' + arg.help.replace('|', '\\|')) - print ('') + s += '- *' + name + '*: ' + arg.help.replace('|', '\\|') + '\n' + s += '\n' if self._description: - print ('Description') - print ('-----------') - print ('') + s += 'Description\n' + s += '-----------\n\n' for line in self._description: - print (line) - print ('') - print ('Options') - print ('-------') + s += line + '\n\n' + s += 'Options\n' + s += '-------\n' for group in reversed(self._action_groups): if group._group_actions and not (len(group._group_actions) == 1 and isinstance(group._group_actions[0], argparse._SubParsersAction)) and not group == self._positionals: - print ('') - print (group.title) - print ('^'*len(group.title)) + s += '\n' + s += group.title + '\n' + s += '^'*len(group.title) + '\n' for option in group._group_actions: text = '/'.join(option.option_strings) if option.metavar: @@ -787,28 +765,24 @@ def printUsageRst(self): text += ' '.join(option.metavar) else: text += option.metavar - print ('') - print ('- **' + text + '** ' + option.help.replace('|', '\\|')) + s += '\n' + s += '- **' + text + '** ' + option.help.replace('|', '\\|') + '\n' if self.citationList: - print ('') - print ('References') - print ('^^^^^^^^^^') + s += '\n' + s += 'References\n' + s += '^^^^^^^^^^\n' for ref in self.citationList: text = '* ' if ref[0]: text += ref[0] + ': ' text += ref[1] - print ('') - print (text) - print ('') - print ('--------------') - print ('') - print ('') - print ('') - print ('**Author:** ' + self._author) - print ('') - print ('**Copyright:** ' + self._copyright) - print ('') + s += '\n' + s += text + '\n' + s += '\n' + s += '--------------\n\n\n\n' + s += '**Author:** ' + self._author + '\n\n' + s += '**Copyright:** ' + self._copyright + '\n\n' + sys.stdout.write(s) if self._subparsers: sys.stdout.flush() for alg in self._subparsers._group_actions[0].choices: @@ -818,7 +792,7 @@ def printUsageRst(self): # A class that can be used to display a progress bar on the terminal, # mimicing the behaviour of MRtrix3 binary commands -class progressBar: #pylint: disable=unused-variable +class progressBar(object): #pylint: disable=unused-variable def _update(self): import os, sys diff --git a/lib/mrtrix3/dwi2response/tax.py b/lib/mrtrix3/dwi2response/tax.py index c48cfa31f3..836bbd2b47 100644 --- a/lib/mrtrix3/dwi2response/tax.py +++ b/lib/mrtrix3/dwi2response/tax.py @@ -28,7 +28,7 @@ def needsSingleShell(): #pylint: disable=unused-variable def execute(): #pylint: disable=unused-variable import math, os, shutil - from mrtrix3 import app, file, image, path, run + from mrtrix3 import app, file, image, path, run #pylint: disable=redefined-builtin lmax_option = '' if app.args.lmax: diff --git a/lib/mrtrix3/dwi2response/tournier.py b/lib/mrtrix3/dwi2response/tournier.py index 39d15c9d47..72e3c243d3 100644 --- a/lib/mrtrix3/dwi2response/tournier.py +++ b/lib/mrtrix3/dwi2response/tournier.py @@ -29,7 +29,7 @@ def needsSingleShell(): #pylint: disable=unused-variable def execute(): #pylint: disable=unused-variable import os, shutil - from mrtrix3 import app, file, image, path, run + from mrtrix3 import app, file, image, path, run #pylint: disable=redefined-builtin lmax_option = '' if app.args.lmax: diff --git a/lib/mrtrix3/fsl.py b/lib/mrtrix3/fsl.py index 86bf541ef0..21493d3f55 100644 --- a/lib/mrtrix3/fsl.py +++ b/lib/mrtrix3/fsl.py @@ -23,29 +23,29 @@ def eddyBinary(cuda): #pylint: disable=unused-variable binaries = [ ] for directory in os.environ['PATH'].split(os.pathsep): if os.path.isdir(directory): - for file in os.listdir(directory): - if file.startswith('eddy_cuda'): - binaries.append(file) + for entry in os.listdir(directory): + if entry.startswith('eddy_cuda'): + binaries.append(entry) max_version = 0.0 - path = '' - for file in binaries: + exe_path = '' + for entry in binaries: try: - version = float(file.lstrip('eddy_cuda')) + version = float(entry.lstrip('eddy_cuda')) if version > max_version: max_version = version - path = file + exe_path = entry except: pass - if path: - app.debug('CUDA version ' + str(max_version) + ': ' + path) - return path + if exe_path: + app.debug('CUDA version ' + str(max_version) + ': ' + exe_path) + return exe_path app.warn('CUDA version of eddy not found; running standard version') if find_executable('eddy_openmp'): - path = 'eddy_openmp' + exe_path = 'eddy_openmp' else: - path = exeName('eddy') - app.debug(path) - return path + exe_path = exeName('eddy') + app.debug(exe_path) + return exe_path diff --git a/lib/mrtrix3/image.py b/lib/mrtrix3/image.py index aec419627c..b121384b7c 100644 --- a/lib/mrtrix3/image.py +++ b/lib/mrtrix3/image.py @@ -4,7 +4,7 @@ # in Python. # Class for importing header information from an image file for reading -class Header: +class Header(object): def __init__(self, image_path): import json, os, subprocess from mrtrix3 import app, path, run diff --git a/lib/mrtrix3/run.py b/lib/mrtrix3/run.py index 870e0f6232..eefb974a2e 100644 --- a/lib/mrtrix3/run.py +++ b/lib/mrtrix3/run.py @@ -36,9 +36,7 @@ def command(cmd, exitOnError=True): #pylint: disable=unused-variable # This splits the command string based on the piping character '|', such that each # individual executable (along with its arguments) appears as its own list - # Note that for Python2 support, it is necessary to convert groupby() output from - # a generator to a list before it is passed to filter() - cmdstack = [ list(g) for k, g in filter(lambda t : t[0], ((k, list(g)) for k, g in itertools.groupby(cmdsplit, lambda s : s != '|') ) ) ] + cmdstack = [ list(g) for k, g in itertools.groupby(cmdsplit, lambda s : s != '|') if k ] for line in cmdstack: is_mrtrix_exe = line[0] in _mrtrix_exe_list From fe4b984d143b614fe6bd349e5168d35aec0b93d6 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 18 Aug 2017 15:39:41 +1000 Subject: [PATCH 078/538] mrtrix3.image.Header: Fixes for accessing members as functions --- bin/dwipreproc | 2 +- lib/mrtrix3/app.py | 2 +- lib/mrtrix3/image.py | 24 ++++++++++++------------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 9b685c1b74..52639d76eb 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -416,7 +416,7 @@ if do_topup: topup_in_path = 'se_epi.mif' # For any non-even axis sizes, crop the first voxel along that dimension crop_option = '' - for axis, axis_size in enumerate(se_epi_header.size[:3]): + for axis, axis_size in enumerate(se_epi_header.size()[:3]): if int(axis_size)%2: crop_option += ' -axis ' + str(axis) + ' 1 ' + str(int(axis_size)-1) if crop_option: diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index 08a2c09ae8..c2c4781c0d 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -303,7 +303,7 @@ def debug(text): #pylint: disable=unused-variable try: origin += ' (from ' + os.path.basename(caller.filename) + ':' + str(caller.lineno) + ')' except: # Prior to Python 3.5 - origin += ' (from ' + os.path.basename(caller[1]) + ':' + str(caller[3]) + ')' + origin += ' (from ' + os.path.basename(caller[1]) + ':' + str(caller[2]) + ')' finally: del caller sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + colourDebug + '[DEBUG] ' + origin + ': ' + text + colourClear + '\n') diff --git a/lib/mrtrix3/image.py b/lib/mrtrix3/image.py index b121384b7c..bb4a4df5f6 100644 --- a/lib/mrtrix3/image.py +++ b/lib/mrtrix3/image.py @@ -71,11 +71,11 @@ def check3DNonunity(image_in): #pylint: disable=unused-variable if not isinstance(image_in, str): app.error('Error trying to test \'' + str(image_in) + '\': Not an image header or file path') image_in = Header(image_in) - if len(image_in.size) < 3: - app.error('Image \'' + image_in.name + '\' does not contain 3 spatial dimensions') - if min(image_in.size[:3]) == 1: - app.error('Image \'' + image_in.name + '\' does not contain 3D spatial information (has axis with size 1)') - app.debug('Image \'' + image_in.name + '\' is >= 3D, and does not contain a unity spatial dimension') + if len(image_in.size()) < 3: + app.error('Image \'' + image_in.name() + '\' does not contain 3 spatial dimensions') + if min(image_in.size()[:3]) == 1: + app.error('Image \'' + image_in.name() + '\' does not contain 3D spatial information (has axis with size 1)') + app.debug('Image \'' + image_in.name() + '\' is >= 3D, and does not contain a unity spatial dimension') @@ -112,22 +112,22 @@ def match(image_one, image_two): #pylint: disable=unused-variable if not isinstance(image_two, str): app.error('Error trying to test \'' + str(image_two) + '\': Not an image header or file path') image_two = Header(image_two) - debug_prefix = '\'' + image_one.name + '\' \'' + image_two.name + '\'' + debug_prefix = '\'' + image_one.name() + '\' \'' + image_two.name() + '\'' # Image dimensions - if image_one.size != image_two.size: - app.debug(debug_prefix + ' dimension mismatch (' + str(image_one.size) + ' ' + str(image_two.size) + ')') + if image_one.size() != image_two.size(): + app.debug(debug_prefix + ' dimension mismatch (' + str(image_one.size()) + ' ' + str(image_two.size()) + ')') return False # Voxel size - for one, two in zip(image_one.spacing, image_two.spacing): + for one, two in zip(image_one.spacing(), image_two.spacing()): if one and two and not math.isnan(one) and not math.isnan(two): if (abs(two-one) / (0.5*(one+two))) > 1e-04: - app.debug(debug_prefix + ' voxel size mismatch (' + str(image_one.spacing) + ' ' + str(image_two.spacing) + ')') + app.debug(debug_prefix + ' voxel size mismatch (' + str(image_one.spacing()) + ' ' + str(image_two.spacing()) + ')') return False # Image transform - for line_one, line_two in zip(image_one.transform, image_two.transform): + for line_one, line_two in zip(image_one.transform(), image_two.transform()): for one, two in zip(line_one, line_two): if abs(one-two) > 1e-4: - app.debug(debug_prefix + ' transform mismatch (' + str(image_one.transform) + ' ' + str(image_two.transform) + ')') + app.debug(debug_prefix + ' transform mismatch (' + str(image_one.transform()) + ' ' + str(image_two.transform()) + ')') return False # Everything matches! app.debug(debug_prefix + ' image match') From f1521d9bce88fb19de75c7430cd6fb329f2f74c7 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 18 Aug 2017 15:58:09 +1000 Subject: [PATCH 079/538] dirgen: Remove compiler warnings --- cmd/dirgen.cpp | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/cmd/dirgen.cpp b/cmd/dirgen.cpp index eaf5823d5a..88d69e0e32 100644 --- a/cmd/dirgen.cpp +++ b/cmd/dirgen.cpp @@ -35,7 +35,7 @@ void usage () SYNOPSIS = "Generate a set of uniformly distributed directions using a bipolar electrostatic repulsion model"; - DESCRIPTION + DESCRIPTION + "Directions are distributed by analogy to an electrostatic repulsion system, with each direction " "corresponding to a single electrostatic charge (for -unipolar), or a pair of diametrically opposed charges " "(for the default bipolar case). The energy of the system is determined based on the Coulomb repulsion, " @@ -43,7 +43,7 @@ void usage () "assumed for the repulsion law (default: 1). The minimum energy state is obtained by gradient descent."; - REFERENCES + REFERENCES + "Jones, D.; Horsfield, M. & Simmons, A. " "Optimal strategies for measuring diffusion in anisotropic systems by magnetic resonance imaging. " "Magnetic Resonance in Medicine, 1999, 42: 515-525" @@ -79,9 +79,9 @@ void usage () class ProjectedUpdate { MEMALIGN(ProjectedUpdate) public: bool operator() ( - Eigen::VectorXd& newx, + Eigen::VectorXd& newx, const Eigen::VectorXd& x, - const Eigen::VectorXd& g, + const Eigen::VectorXd& g, double step_size) { newx.noalias() = x - step_size * g; for (ssize_t n = 0; n < newx.size(); n += 3) @@ -98,7 +98,7 @@ class ProjectedUpdate { MEMALIGN(ProjectedUpdate) class Energy { MEMALIGN(Energy) public: - Energy (ProgressBar& progress) : + Energy (ProgressBar& progress) : progress (progress), ndirs (to (argument[0])), bipolar (!(get_options ("unipolar").size())), @@ -113,13 +113,13 @@ class Energy { MEMALIGN(Energy) size_t size () const { return 3 * ndirs; } - // set x to original directions provided in constructor. + // set x to original directions provided in constructor. // The idea is to save the directions from one run to initialise next run // at higher power. - double init (Eigen::VectorXd& x) + double init (Eigen::VectorXd& x) { Math::RNG::Normal rng; - for (ssize_t n = 0; n < ndirs; ++n) { + for (size_t n = 0; n < ndirs; ++n) { auto d = x.segment (3*n,3); d[0] = rng(); d[1] = rng(); @@ -146,26 +146,26 @@ class Energy { MEMALIGN(Energy) Eigen::Vector3d r = d1-d2; double _1_r2 = 1.0 / r.squaredNorm(); double _1_r = std::sqrt (_1_r2); - double e = fast_pow (_1_r, power); + double e = fast_pow (_1_r, power); E += e; - g1 -= (power * e * _1_r2) * r; - g2 += (power * e * _1_r2) * r; + g1 -= (power * e * _1_r2) * r; + g2 += (power * e * _1_r2) * r; if (bipolar) { r = d1+d2; _1_r2 = 1.0 / r.squaredNorm(); _1_r = std::sqrt (_1_r2); - e = fast_pow (_1_r, power); + e = fast_pow (_1_r, power); E += e; - g1 -= (power * e * _1_r2) * r; - g2 -= (power * e * _1_r2) * r; + g1 -= (power * e * _1_r2) * r; + g2 -= (power * e * _1_r2) * r; } } } // constrain gradients to lie tangent to unit sphere: - for (size_t n = 0; n < ndirs; ++n) + for (size_t n = 0; n < ndirs; ++n) g.segment(3*n,3) -= x.segment(3*n,3).dot (g.segment(3*n,3)) * x.segment(3*n,3); return E; @@ -174,7 +174,7 @@ class Energy { MEMALIGN(Energy) // function executed per thread: - void execute () + void execute () { size_t this_start = 0; while ((this_start = current_start++) < restarts) { @@ -189,7 +189,7 @@ class Energy { MEMALIGN(Energy) size_t iter = 0; for (; iter < niter; iter++) { - if (!optim.iterate()) + if (!optim.iterate()) break; DEBUG ("start " + str(this_start) + ": [ " + str (iter) + " ] (pow = " + str (power) + ") E = " + str (optim.value(), 8) @@ -244,13 +244,13 @@ Eigen::VectorXd Energy::best_directions; -void run () +void run () { Energy::restarts = get_option_value ("restarts", DEFAULT_RESTARTS); Energy::target_power = get_option_value ("power", DEFAULT_POWER); Energy::niter = get_option_value ("niter", DEFAULT_NITER); - { + { ProgressBar progress ("Optimising directions up to power " + str(Energy::target_power) + " (" + str(Energy::restarts) + " restarts)"); Energy energy_functor (progress); auto threads = Thread::run (Thread::multi (energy_functor), "energy function"); @@ -259,7 +259,7 @@ void run () CONSOLE ("final energy = " + str(Energy::best_E)); size_t ndirs = Energy::best_directions.size()/3; Eigen::MatrixXd directions_matrix (ndirs, 3); - for (int n = 0; n < ndirs; ++n) + for (size_t n = 0; n < ndirs; ++n) directions_matrix.row (n) = Energy::best_directions.segment (3*n, 3); DWI::Directions::save (directions_matrix, argument[1], get_options ("cartesian").size()); From a3e6702a060b7ddef15cc7fcb01282c75b40489b Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 22 Aug 2017 12:55:36 +1000 Subject: [PATCH 080/538] FAQ: Update ACT termination instructions for mrview upgrade Displaying streamlines terminations as dot points can now be achieved in MRtrix3, and hence the instructions for using mrview from MRtrix 0.2 version with the Depth Blend option is no longer relevant. --- docs/troubleshooting/FAQ.rst | 71 ++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/docs/troubleshooting/FAQ.rst b/docs/troubleshooting/FAQ.rst index fca499c1f2..6e034e8298 100644 --- a/docs/troubleshooting/FAQ.rst +++ b/docs/troubleshooting/FAQ.rst @@ -56,7 +56,7 @@ assumption. To me, there are two possible ways that this could be handled: - Generate a representation of the response function that can be interpolated / extrapolated as a function of b-value, and therefore choose an appropriate - response function per voxel. + response function per voxel. Work is underway to solve these issues, but there's nothing available yet. For those wanting to pursue their own solution, bear in mind that the gradient @@ -249,46 +249,53 @@ used in these figures, which I'll explain here in full. - Figures 5 and 7 display large dots at the streamline endpoints lying within the displayed slab, in conjunction with the streamlines themselves and a - background image. Unfortunately this functionality is not yet - implemented within *MRtrix3*, so duplicating this type of visualisation - requires a bit of manual manipulation and software gymnastics: + background image. This can be achieved as follows: - - Use the new ``tckresample`` command, with the ``-endpoints`` option, - to generate a new track file that contains only the two endpoints of + - Use the ``tckresample`` command with the ``-endpoints`` option to + generate a new track file that contains only the two endpoints of each streamline. - - Load this track file into the *old MRtrix 0.2 version of ``mrview``*. - This software can be acquired `here `__. - Note that you will likely want to *not* run the installation component - of the build for this software; that way you should not encounter - issues with conflicting commmand names between MRtrix versions. This - does however mean that you will need to provide the full path to the - MRtrix 0.2 ``mrview`` executable in order to run it. + - Load this track file into ``mrview``. - - Within the ``mrview`` tractography tool, enable the 'depth blend' - option. This will display each streamline point as a dot, rather than - drawing lines between the streamline points. + - Within the ``mrview`` tractography tool, for the "Geometry" option, + select "Points". + +This will display each streamline point as a dot, rather than drawing lines +between each streamline point. Since this track file contains only two points +per streamline, corresponding to the streamline endpoints, this means that a +dot is drawn at each streamline endpoint. + +In Figure 7, each streamline endpointis coloured red. Figure 5 is slightly +trickier, and requires some image editing trickery: + + - Display *only* the streamline endpoints track file. + + - Colour each "track" according to direction (this will colour each point + according to the "direction" between the two endpoints). - Adjust the brightness / contrast of the background image so that it is - completely black. + completely black, and disable all other tools/geometry (so that only the + termination points are visible). - Take a screenshot. - - Remove the streamline endpoints track file from the tractography tool, - and disable the 'depth blend' option (it's best to disable the 'depth - blend' option before opening any larger track file). - - - Reset the windowing of the main image, and/or load the complete tracks - file, and take an additional screenshot, making sure not to move the - view focus or resize the ``mrview`` window (so that the two screenshots - overlay on top of one another). - - - The two screenshots are then combined using image editing software such - as GIMP. The colors of the termination points can also be modified - independently before they are combined with the second screenshot. One - trick I used in this manuscript was to rotate the hue of the termination - screenshot by 180 degrees: this provides a pseudo-random coloring of the - termination points that contrasts well against the tracks. + - Disable the streamline endpoints track file within the tractography tool, + set up whatever background image / tracks you wish to combine within + your image, and take another screenshot. Make sure to not move the + view focus or resize the ``mrview`` window, so that the two screenshots + will overlay directly on top of one another. + + - Open the two screenshots using image editing software such as GIMP. + + - In Figure 5, a trick I used was to take the endpoint termination + screenshot, and *rotate the hue* by 180 degrees: this provides a + pseudo-random coloring of the termination points that contrasts well + against the surrounding tracks. + + - Within the image editing software, make the termination point screenshot + *transparent* where the termination points are not drawn, and then overlay + it with the second screenshot (in GIMP, you can use "Copy" -> "Paste as + new layer"). Compiler error during build From c25352d1a44f47005a160e14d243edce93bbc715 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 22 Aug 2017 16:35:54 +1000 Subject: [PATCH 081/538] Documentation: Suggestions from David Abbott - Re-order and modify page on fixels and dixels to emphasize that 'fixel' is the dominant term, and 'dixel' may not be relevant for many readers. - Couple of spelling errors fixed. - Add instructions on how to deal with 'too many open files' error. --- docs/concepts/afd_connectivity.rst | 2 +- docs/concepts/dixels_fixels.rst | 100 ------------ docs/concepts/fixels_dixels.rst | 155 +++++++++++++++++++ docs/getting_started/image_data.rst | 54 +++---- docs/troubleshooting/hanging_or_crashing.rst | 57 +++++++ 5 files changed, 240 insertions(+), 128 deletions(-) delete mode 100644 docs/concepts/dixels_fixels.rst create mode 100644 docs/concepts/fixels_dixels.rst diff --git a/docs/concepts/afd_connectivity.rst b/docs/concepts/afd_connectivity.rst index 92765bbe3d..0fe420dafb 100644 --- a/docs/concepts/afd_connectivity.rst +++ b/docs/concepts/afd_connectivity.rst @@ -21,7 +21,7 @@ The afdconnectivity command attempts to get around this issue by estimating a measure of 'connectivity' as follows: - The integral of a discrete lobe of an FOD - (:ref:`fixel `) is proportional to the volume of + (:ref:`fixel `) is proportional to the volume of the MR-visible tissue (intra-cellular at high *b*-value) aligned in that direction. diff --git a/docs/concepts/dixels_fixels.rst b/docs/concepts/dixels_fixels.rst deleted file mode 100644 index 68c369de93..0000000000 --- a/docs/concepts/dixels_fixels.rst +++ /dev/null @@ -1,100 +0,0 @@ -.. _dix_fix: - -Dixels and Fixels -================= - -So internally we have created a couple of new terms that we find -invaluable when discussing diffusion MRI processing methods and -statistics. We'd like to share these with our user base in the hope that -others will gain advantages from using the same terminology, and also so -that we all know what everyone else is talking about! Anyone using -*MRtrix3* to develop their own software may also see these terms scattered -throughout the library code, so will need to know what they represent. - -All MRtrix users should be familiar with the terms 'pixel' and 'voxel'; -these correspond to 'picture element' and 'volume element' respectively. -However in Diffusion MRI we also deal with orientation information -within each image volume element, so we wanted terminology to allow us -to convey the types of discrete elements that we deal with on a daily -basis. - -We have settled on the following terms; note that this may conflict with -presentations that we have done in the past, but this is now what we are -sticking to. - -'Dixel': *Directional Element* ------------------------------- - -Imagine a single image voxel, the data for which is in fact a function -on the sphere (i.e. varies with orientation). We now take samples of -that function along a set of pre-defined directions on the unit sphere. -Each of those samples is referred to as a *dixel*: a directional element -within a specific voxel. Each dixel is described by the voxel in which -it resides, the direction along which the relevant spherical function -was sampled, and the intensity of the function in that direction. - -Importantly, it is the *combination* of the voxel location and sampling -direction that describe the dixel. If a different direction were used to -sample the spherical function, that would be a different dixel with a -different value; likewise, if the spherical function in an adjacent -voxel were sampled along the same direction, that would also be a -different dixel with a different value. Each dixel is a unique sample of -a spatially-varying spherical function. - -Most commonly, the term dixel is used to refer to the situation where a -set of directions on the unit sphere has been used to sample a Fibre -Orientation Distribution (FOD) that is otherwise continuous as expressed -in the Spherical Harmonic basis. However, by the definition of the term, -'dixel' could also be used to describe a single voxel within a -particular image volume in a HARDI experiment; if the HARDI signal in a -single voxel is considered to be discrete samples of the orientation -dependence of the diffusion signal in that voxel, then each of those -samples could be labelled a dixel. - -Although we find this term useful in our internal discussions, and the -original Apparent Fibre Density (AFD) statistical method was based -around this concept, it is not a term that we expect to be adopted by -others, as its applicability for the end user is limited. - -'Fixel': *Fibre bundle element* -------------------------------- - -It will be more common to hear use of the term *fixel*; this refers to a -specific fibre bundle within a specific voxel. Each fixel is therefore -parametrized by the voxel in which it resides, the estimated mean -direction of the underlying fibres attributed to that bundle, a fibre -density (or partial volume fraction), and potentially other metrics. - -At this point it is important to distinguish between 'dixel' and -'fixel'. A 'dixel' is typically assumed to represent a sample of a -spherical function along some pre-determined direction, where that -direction belongs to some basis set of equally-distributed unit -directions that has been used to sample an otherwise continuous -spherical function. 'Fixel', on the other hand, is used to describe a -set of fibres within a voxel that are sufficiently similar in -orientation that they are indistinguishable from one another, and -therefore form a fibre 'bundle' within that voxel. - -In reality, fixels have been used in the field of Diffusion MRI for a -long time: multi-tensor fitting, ball-and-sticks, any diffusion model -that is capable of fitting multiple anisotropic elements to each image -voxel, can be considered as providing fixels. We've just resorted to -long-winded explanations to describe what we're on about. With MRtrix we -are historically more accustomed to dealing with FODs that are -continuous functions on the sphere, and are utilised as such during -processing; however, if the FOD is *segmented* in any way (either -through peak-finding, the segmentation approach as described in the -appendices of the -`SIFT NeuroImage paper `_, -or more advanced methods), each discrete feature of a particular FOD can -be labelled a fixel, as each represents a set of fibres within that voxel -that form a coherent bundle in orientation space. - -The term 'fixel' has now appeared in the literature with the publication -of our new statistical method, -`Connectivity-based Fixel Enhancement `_, -which allows for the inference of group differences not just at the voxel -level, but the *fixel* level; that is, if only one fibre bundle within a -crossing-fibre voxel is affected in a cohort, we hope to both identify the -bundle affected, and quantify the group effect that is specific to that bundle. - diff --git a/docs/concepts/fixels_dixels.rst b/docs/concepts/fixels_dixels.rst new file mode 100644 index 0000000000..cea2d12193 --- /dev/null +++ b/docs/concepts/fixels_dixels.rst @@ -0,0 +1,155 @@ +.. _fixels_dixels: + +"Fixels" (and "Dixels") +======================= + +So internally we have created a couple of new terms that we find +invaluable when discussing diffusion MRI processing methods and +statistics. We'd like to share these with our user base in the hope that +others will gain advantages from using the same terminology, and also so +that we all know what everyone else is talking about! Anyone using +*MRtrix3* to develop their own software may also see these terms scattered +throughout the library code, so will need to know what they represent. + +All *MRtrix3* users should be familiar with the terms 'pixel' and 'voxel'; +these correspond to 'picture element' and 'volume element' respectively. +However in Diffusion MRI we also deal with orientation information +within each image volume element, so we wanted terminology to allow us +to convey the types of discrete elements that we deal with on a daily +basis. + +We have settled on the following two terms. The first of these, 'fixel', +will appear frequently in this documentation and in online discussions, +and will therefore satisfy the requirements of the majority of users. +The second, 'dixel', is typically reserved for internal technical +discussion; however due to its occasional usage (and its conflict with +prior presentations that used a different meaning for this term), we are +additionally providing its full definition here for interested readers. + +'Fixel': *Fibre bundle element* +------------------------------- + +The term *fixel* refers to a *specific fibre bundle* within a *specific +voxel*. Alternatively, consistently with the definitions of 'pixel' and +'voxel', it can be thought of as a 'fibre bundle element': the smallest +discrete component of a fibre bundle. Each fixel is parameterized by +the voxel in which it resides, the estimated mean orientation of the +underlying fibres attributed to that bundle, a fibre density (or partial +volume fraction), and potentially other metrics. + +In reality, fixels have been used in the field of Diffusion MRI for a +long time: multi-tensor fitting, ball-and-sticks, any diffusion model +that is capable of fitting multiple anisotropic elements to each image +voxel, can be considered as estimating fixels. However in the past, +researchers have resorted either to long-winded explanations in an +attempt to describe the nature of the data being manipulated, or have +defined their own terms that have been both non-specific and inconsistent +between publications; we hope that the term 'fixel', being unambiguous with +other interpretations of "fibre bundle" or "fascicle" or other examples, +will slowly become the standard term for describing these data. + +Historically, in MRtrix we are accustomed to dealing with FODs that are +*continuous* functions on the sphere, rather than having a discrete number +of fibre directions in each voxel. However, if the FOD is *segmented* in +any way (either through peak-finding as shown in `this paper `_ +and implemented in the ``sh2peaks`` command, the segmentation algorithm +described in the appendices of the `SIFT NeuroImage paper `_ +and provided in the ``fod2fixel`` command, or more advanced methods), each +discrete feature of a particular FOD can be labelled a 'fixel', as each +represents a set of fibres within that voxel that form a coherent bundle +in orientation space. + +The term 'fixel' has now appeared in the literature with the publication +of the statistical method, +`Connectivity-based Fixel Enhancement `_, +as well as the more general framework of `Fixel-Based Analysis `_, +which together allow for the inference of group differences not just at +the voxel level, but the *fixel* level; that is, if only one fibre bundle +within a crossing-fibre voxel is affected in a cohort, we hope to both +identify the bundle affected, and quantify the group effect that is specific +to that bundle. + +'Dixel': *Directional Element* +------------------------------ + +This term is used less frequently, and hence may not be relevant for all +readers. If you have not seen it used before, you may in fact prefer to +avoid the following text in order to keep things simple... + +Imagine a single image voxel, the data for which is in fact a function +on the sphere (i.e. varies with orientation). We now take samples of +that function along a set of pre-defined directions on the unit sphere. +Each of those samples is referred to as a '*dixel*': a *directional element* +within a *specific voxel*. Each dixel is described by the voxel in which +it resides, the direction along which the relevant spherical function +was sampled, and the intensity of the function in that direction. + +Importantly, it is the *combination* of the voxel location and sampling +direction that describe the dixel. If a different direction were used to +sample the spherical function, this would be a different dixel with a +different associated value; likewise, if the spherical function in an +adjacent voxel were sampled along the same direction, that would also be a +different dixel with a different associated value. Each dixel is a unique +sample of a particular spatially-varying spherical function. + +Most commonly, the term 'dixel' is used to refer to the situation where a +*set of directions* on the unit sphere has been used to sample some function; +for instance, sampling the amplitudes of a Fibre Orientation Distribution +(FOD), which is otherwise a continuous function expressed in the Spherical +Harmonic (SH) basis. However, by the definition of the term, +'dixel' could also be used to describe a single voxel within a +particular image volume in a HARDI experiment; if the HARDI signal in a +single voxel is considered to be discrete samples of the orientation +dependence of the diffusion signal in that voxel, then each of those +samples could be labelled a 'dixel'. + +Therefore, the fundamental disambiguation between 'fixels' and 'dixels' is +as follows: + +- A 'dixel' is typically assumed to represent a sample of a spherical + function along some pre-determined direction, where that direction + belongs to some dense *basis set* of equally-distributed unit directions + that has been used to sample an otherwise continuous (hemi-)spherical + function. + +- 'Fixel', on the other hand, is used to describe a *set of fibres* within + a voxel that are sufficiently similar in orientation that they are + indistinguishable from one another, and therefore form a fibre 'bundle' + within that voxel. + +Some observations / contexts in which the term 'dixel' may be useful: + +- The ``mrview`` "ODF overlay" tool is capable of loading "Dixel ODFs". + These can be either a set of direction-based samples on the sphere, or + it can be used to directly visualise the diffusion signal within a + particular *b*-value shell, since both of these cases correspond to a + set of directions on the unit hemisphere, where each direction has + associated with it an 'intensity' / 'amplitude'. + +- In the original Apparent Fibre Density (AFD) `manuscript `_, + the statistical analysis was performed by performing a t-test in each + of 200 directions in each voxel, and then detecting connected clusters + in position & orientation space. This can be thought of as "dixel-based + cluster statistics". + +- In the FOD segmentation method provided in the ``fod2fixel`` command + mentioned earlier, the algorithm first samples the amplitude of the + FOD along a set of 1,281 directions, before identifying fixels based + on accumulating these directions / samples. So this process can be + thought of as converting the FOD from a continuous SH representation, + to a dixel representation, then finally to a fixel representation. + +:: NOTE: + + During the development of many of the aforementioned methods, + `a presentation `_ was made at + ISMRM demonstrating "Tractographic threshold-free cluster enhancement" + (this is now referred to as "Connectivity-based Fixel Enhancement (CFE)". + During the presentation itself, the term 'dixel' was used to refer to a + specific direction within a specific voxel; but a direction that + corresponds to a particular fible bundle in that voxel. You may observe + that this definition is in fact consistent with what we have labelled + here as a 'fixel', rather than a 'dixel'; this is because at the time + when this presentation was made, these two terms had not yet been + disambiguated. The definitions made within this documentation page are + what will be used from now on by the *MRtrix3* developers. diff --git a/docs/getting_started/image_data.rst b/docs/getting_started/image_data.rst index a1dd5b3de8..84a4ca42f9 100644 --- a/docs/getting_started/image_data.rst +++ b/docs/getting_started/image_data.rst @@ -188,7 +188,7 @@ the combination of the *image axes* and the *location of the corner voxel*. This information is encapsulated in the *transformation matrix*, commonly referred to simply as the *transform*. You can view the transform for any image using :ref:`mrinfo`, for example:: - + $ mrinfo dwi.mif ************************************************ Image: "dwi.mif" @@ -212,12 +212,12 @@ The 'Transform' field above shows the first 3 rows of the transformation matrix (technically, this is a 4×4 matrix, but the last row is always set to ``[ 0 0 0 1 ]``). The first 3 columns correspond to the *x*, *y* & *z* image axes respectively, while the last column corresponds to the location *in real -(scanner/world) space* of the corner voxel (i.e. the voxel at index ``[ 0 0 0 ]``). +(scanner/world) space* of the corner voxel (i.e. the voxel at index ``[ 0 0 0 ]``). In *MRtrix3*, the transform shown always corresponds to the transformation from image coordinates *in millimeters* to scanner coordinates *in millimeters* - the voxel size is not taken into account, and the image axes are always -normalised to unit amplitude. This may differ from other packages. +normalised to unit amplitude. This may differ from other packages. Furthermore, *MRtrix3* will always present the transform that best matches the real space. If the transform of the image on file represents a large rotation, @@ -243,20 +243,20 @@ last one, until the whole image has been stored. This ordering scheme is what is typically used in the NIfTI standard, and is commonly referred to as RAS (right anterior posterior), referring to the direction of traversal of each axis in turn. This scheme is also often referred to as *neurological*, although -this term is in general much more ambiguous. +this term is in general much more ambiguous. However, this is only a convention, and many other combinations are possible. For instance, it is possible to start from the *right* posterior inferior corner, and raster through along the *left* direction, then store the next row along the anterior direction, and finally the next slice in the superior direction. This scheme is what is normally used in the now deprecated Analyse -format, and is commonly referred to as LAS or *radiological*. +format, and is commonly referred to as LAS or *radiological*. Of course, there are many more possibilities. For instance, sagittal DICOM images will typically be stored using a PIR (posterior inferior right) order, since each sagittal slice is stored in order, etc. *MRtrix3* applications are agnostic to the order of storage, and can handle any such images provided the -format is clear about what the order is. +format is clear about what the order is. In *MRtrix3*, the order of storage is defined by their *strides*. These refer to the number of voxels between a given voxel and the next voxel along a given @@ -272,7 +272,7 @@ provides *symbolic* strides. For example, the RAS strides above would be expressed as ``1,2,3``, since this is sufficient to deduce the actual strides once the image dimensions are known. Likewise, LAS would correspond to strides of ``-1,2,3``, PIR to ``3,-1,-2``, etc. This has the advantage that the -specification of the strides is then independent of the image dimensions. +specification of the strides is then independent of the image dimensions. Using strides to specify ordering also allows the specification to generalise to arbitrary dimensions. For example, it is fairly common for @@ -295,7 +295,7 @@ Likewise, if you need to ensure the orientation is neurological (RAS), you can specify strides ``1,2,3,4`` (or use the ``1:4`` shorthand). You can also specify other combinations if required: for example ``-stride -2,-1,3,4`` would correspond to a PLS coordinate system, ``-stride 2,3,4,1`` would correspond to -volume-contiguous storage (with RAS for the spatial axes), etc. +volume-contiguous storage (with RAS for the spatial axes), etc. The different formats supported by *MRtrix3* differ in the range of strides that they support. The :ref:`mrtrix_image_formats` are the only formats to @@ -330,13 +330,13 @@ matrix will always be modified as necessary to bring it close to the standard coordinate system, so that the first image axis is close to the *x* axis, etc. This allows *MRtrix3* applications to operate on images in the knowledge that these axes are always anatomically as expected, without worrying about the -details of *how* this information was actually stored on file. +details of *how* this information was actually stored on file. It is important to bear this in mind when interpreting for output of :ref:`mrinfo` for example, since this produces the strides and transform *as interpreted by MRtrix3*, rather than those actually stored on file - although the two representations should be strictly equivalent. If you need to inspect -the information as stored on file, use :ref:`mrinfo`'s ``-norealign`` option. +the information as stored on file, use :ref:`mrinfo`'s ``-norealign`` option. .. _supported_image_formats: @@ -376,19 +376,19 @@ Compressed MRtrix image format (``.mif.gz``) ............................................ *MRtrix3* also supports the compressed version of the single-file ``.mif`` -format, both for reading and writing. +format, both for reading and writing. .. NOTE:: While this can reduce file sizes, it does incur a runtime cost when reading or writing the image (a process that can often take longer than the operation to be performed), and will require the entire image to be loaded uncompressed into - RAM (*MRtrix3* can otherwise make use of + RAM (*MRtrix3* can otherwise make use of `memory-mapping `__ to keep RAM requirements to a minimum). For large files, these costs can become considerable; you may find that *MRtrix3* can process a large uncompressed image, yet run out of RAM when presented with the equivalent compressed version (in such cases, you can try using ``gunzip`` to uncompress the file - manually before invoking the relevant *MRtrix3* command). + manually before invoking the relevant *MRtrix3* command). Header structure ................ @@ -416,7 +416,7 @@ All following lines are in the format ``key: value``, with the value entry extending up to the end of the line. All whitespace characters before and after the value entry are ignored. Some keys are required to read the images, others are optional (sensible defaults will be -substituted if they are absent). Recognised keys are provided in the +substituted if they are absent). Recognised keys are provided in the list below, along with the expected format of the corresponding values. - **dim** [required] @@ -430,7 +430,7 @@ list below, along with the expected format of the corresponding values. the voxel size along each dimension, as a comma-separated list of floating-point values. The number of entries should match that given in the dim entry. For example: ``vox: 0.9,0.898438,0.898438``. - + - **layout** [required] specifies the organisation of the data on file. In simplest terms, it @@ -455,7 +455,7 @@ list below, along with the expected format of the corresponding values. - **datatype** [required] - the datatype used to store individual voxel values. See the listing of + the datatype used to store individual voxel values. See the listing of valid :ref:`data_types`. For example: ``datatype: UInt16LE`` - **file** [required] @@ -543,7 +543,7 @@ NIfTI & NIfTI-2 (``.nii``) '''''''''''''''''''''''''' These file formats are supported both for reading and writing, and allows -interoperation with other packages such as `SPM `__ +interoperation with other packages such as `SPM `__ or `FSL `__. The ``mrinfo`` command can be used to determine whether a particular image is in NIfTI-1 or NIfTI-2 format. @@ -566,13 +566,13 @@ reading and writing. While this can reduce file sizes, it does incur a runtime cost when reading or writing the image (a process that can often take longer than the operation to be performed), and will require the entire image to be loaded uncompressed into - RAM (*MRtrix3* can otherwise make use of + RAM (*MRtrix3* can otherwise make use of `memory-mapping `__ to keep RAM requirements to a minimum). For large files, these costs can become considerable; you may find that *MRtrix3* can process a large uncompressed image, yet run out of RAM when presented with the equivalent compressed version (in such cases, you can try using ``gunzip`` to uncompress the file - manually before invoking the relevant *MRtrix3* command). + manually before invoking the relevant *MRtrix3* command). .. _mgh_formats: @@ -592,7 +592,7 @@ This file format is supported both for reading and writing. However, when writing, the newer NIfTI standard will be used, since the Analyse format cannot store crucial information such as the image transform, and is hence deprecated. If these images are actually stored as NIfTI, they will be handled -appropriately according to the standard. +appropriately according to the standard. .. NOTE:: In order to specify an Analyse format image on the command line, type the name @@ -607,11 +607,11 @@ appropriately according to the standard. .. _mrtrix_sparse_format: .. _fixel_format: -Fixel image (directory) format +Fixel image (directory) format ------------------------------ Images for representing discrete multi-fibre models are sparse in nature (i.e. different voxels may have different numbers of -fibre populations - a.k.a *`fixels `__*), and different models have different parameter requirements per fixel (e.g. orientation, +fibre populations - a.k.a *`fixels `__*), and different models have different parameter requirements per fixel (e.g. orientation, volume fraction, fanning, tensors etc). This fixel image format overcomes several issues in storing such data in either traditional 4D images or a custom format (such as the legacy :ref:`legacy_mrtrix_sparse_format`). @@ -729,10 +729,10 @@ while colour-coding by effect size. Legacy MRtrix Sparse Format (``.msh / .msf``) --------------------------------------------- -This is an old lecacy format prevously used for applications where the number -of discrete elements within a voxel may vary between voxels -(typically used to store fixels). This format has been superseded by the -new directory-based :ref:`fixel_format`. While all fixel-related +This is an old legacy format prevously used for applications where the number +of discrete elements within a voxel may vary between voxels +(typically used to store fixels). This format has been superseded by the +new directory-based :ref:`fixel_format`. While all fixel-related commands now only use the new format, files stored in the legacy format can still be viewed in ``mrview``. @@ -822,7 +822,7 @@ only required keys are the following: - **datatype** - specifies the datatype (and byte order). At this points only the + specifies the datatype (and byte order). At this point only the Float32 data type is supported, either as little-endian (LE) or big-endian (BE). diff --git a/docs/troubleshooting/hanging_or_crashing.rst b/docs/troubleshooting/hanging_or_crashing.rst index 1df10a17f5..5e67f58434 100644 --- a/docs/troubleshooting/hanging_or_crashing.rst +++ b/docs/troubleshooting/hanging_or_crashing.rst @@ -147,3 +147,60 @@ A few pointers for anybody who encounters this issue: store non-linear warp fields across many subjects. This may explain why one script crashed when other scripts have completed successfully. + +``mrview`` unable to open images: "Too many open files" +------------------------------------------------------- + +It is possible to encounter this error message particularly if trying to +open a large number of DICOM images. In most cases, each slice in a +DICOM series is stored in an individual file; all of these files must remain +open while the image is loaded. In addition, the maximum number of files +open at any time (imposed by the kernel, *not* *MRtrix3*) may be relatively +small (e.g. 256), such that very few subjects can be opened at once. + +There are two ways to solve this issue: + +- *Reduce the number of files opened concurrently*: By converting each series + of interest to an alternative format (e.g. (:ref:` ``.mif`` <_mrtrix_image_formats>`)) + before opening them in ``mrview``, the total number of files open at once + will be drastically reduced. + +- *Increase the limit on number of files opened*: If directly opening DICOM + images without first converting them is more convenient, then it is + possible to instead increase the kernel's upper limit on the number of + files that can remain open at once. The specific details on how this is + done may vary between different OS's / distributions, but here are a couple + of suggestions to try: + + - The current limit should be reported by: + + :: + + ulimit -n + + - Try running the following (potentially with the use of ``sudo``): + + :: + + sysctl -w fs.file-max=100000 + + If this solves the issue, the change can be made permanent by editing + file ``/etc/sysctl.conf``, adding the following line (replacing + ```` with your desired upper limit): + + :: + + fs.file-max = + + On MacOSX, you may instead need to look at the ``kern.maxfiles`` and + ``kern.maxfilesperproc`` parameters. + + - Set the new upper limit using ``ulimit`` (you can try using a number + instead of "unlimited" if you choose to): + + :: + + ulimit -n unlimited + + If this works, you will need to add that line to a file such as + ``~/.bashrc`` in order for the change to be applied permanently. From 29fd39d1f05b57234fd58af80fc8727e6750b80e Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 22 Aug 2017 16:39:18 +1000 Subject: [PATCH 082/538] docs/index.rst: Reflect move of fixels / dixels page --- docs/index.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 9cf696cf4e..a33ab01dd6 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -35,7 +35,7 @@ These applications have been written from scratch in C++, using the functionalit .. toctree:: :maxdepth: 1 :caption: Getting started - + getting_started/key_features getting_started/commands_and_scripts getting_started/beginner_dwi_tutorial @@ -48,8 +48,8 @@ These applications have been written from scratch in C++, using the functionalit :caption: DWI Pre-processing dwi_preprocessing/denoising - dwi_preprocessing/dwipreproc - + dwi_preprocessing/dwipreproc + .. toctree:: :maxdepth: 1 :caption: Constrained Spherical Deconvolution @@ -69,7 +69,7 @@ These applications have been written from scratch in C++, using the functionalit quantitative_structural_connectivity/labelconvert_tutorial quantitative_structural_connectivity/global_tractography quantitative_structural_connectivity/ismrm_hcp_tutorial - + .. toctree:: :maxdepth: 1 :caption: Fixel-Based Analysis @@ -79,7 +79,7 @@ These applications have been written from scratch in C++, using the functionalit fixel_based_analysis/computing_effect_size_wrt_controls fixel_based_analysis/displaying_results_with_streamlines .. fixel_based_analysis/fba_of_other_measures - + .. toctree:: :maxdepth: 1 :caption: Spatial Normalisation @@ -91,11 +91,11 @@ These applications have been written from scratch in C++, using the functionalit .. toctree:: :maxdepth: 1 :caption: Concepts - + concepts/dw_scheme concepts/global_intensity_normalisation concepts/orthonormal_basis - concepts/dixels_fixels + concepts/fixels_dixels concepts/afd_connectivity .. toctree:: @@ -118,7 +118,7 @@ These applications have been written from scratch in C++, using the functionalit .. toctree:: :maxdepth: 1 :caption: Reference - + reference/commands_list reference/scripts_list reference/config_file_options From 7657ce1ff3fa925ad8be6de3ac3cc50f00fd9655 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 22 Aug 2017 17:07:05 +1000 Subject: [PATCH 083/538] Docs, Fixels page: Fixes --- docs/concepts/fixels_dixels.rst | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/docs/concepts/fixels_dixels.rst b/docs/concepts/fixels_dixels.rst index cea2d12193..b481dbab68 100644 --- a/docs/concepts/fixels_dixels.rst +++ b/docs/concepts/fixels_dixels.rst @@ -12,18 +12,19 @@ that we all know what everyone else is talking about! Anyone using throughout the library code, so will need to know what they represent. All *MRtrix3* users should be familiar with the terms 'pixel' and 'voxel'; -these correspond to 'picture element' and 'volume element' respectively. -However in Diffusion MRI we also deal with orientation information -within each image volume element, so we wanted terminology to allow us -to convey the types of discrete elements that we deal with on a daily -basis. +these are abbreviations of "picture element" and "volume element", +corresponding to the smallest element within a 2D picture and 3D volume +respectively. However in Diffusion MRI we also deal with *orientation* +information within each image volume element; so we wanted terminology +to allow us to convey the types of discrete elements that we deal with +on a daily basis. We have settled on the following two terms. The first of these, 'fixel', -will appear frequently in this documentation and in online discussions, -and will therefore satisfy the requirements of the majority of users. -The second, 'dixel', is typically reserved for internal technical -discussion; however due to its occasional usage (and its conflict with -prior presentations that used a different meaning for this term), we are +will appear frequently throughout the *MRtrix3* documentation and in +online discussions, and will therefore satisfy the requirements of the +majority of users. The second, 'dixel', is typically reserved for internal +technical discussion; however due to its occasional usage (and its conflict +with prior presentations that used a different meaning for this term), we are additionally providing its full definition here for interested readers. 'Fixel': *Fibre bundle element* @@ -31,7 +32,7 @@ additionally providing its full definition here for interested readers. The term *fixel* refers to a *specific fibre bundle* within a *specific voxel*. Alternatively, consistently with the definitions of 'pixel' and -'voxel', it can be thought of as a 'fibre bundle element': the smallest +'voxel', it can be thought of as a "fibre bundle element": the smallest discrete component of a fibre bundle. Each fixel is parameterized by the voxel in which it resides, the estimated mean orientation of the underlying fibres attributed to that bundle, a fibre density (or partial @@ -53,7 +54,7 @@ Historically, in MRtrix we are accustomed to dealing with FODs that are of fibre directions in each voxel. However, if the FOD is *segmented* in any way (either through peak-finding as shown in `this paper `_ and implemented in the ``sh2peaks`` command, the segmentation algorithm -described in the appendices of the `SIFT NeuroImage paper `_ +described in the appendices of the `SIFT NeuroImage paper `_ and provided in the ``fod2fixel`` command, or more advanced methods), each discrete feature of a particular FOD can be labelled a 'fixel', as each represents a set of fibres within that voxel that form a coherent bundle @@ -139,12 +140,12 @@ Some observations / contexts in which the term 'dixel' may be useful: thought of as converting the FOD from a continuous SH representation, to a dixel representation, then finally to a fixel representation. -:: NOTE: +.. NOTE:: During the development of many of the aforementioned methods, `a presentation `_ was made at ISMRM demonstrating "Tractographic threshold-free cluster enhancement" - (this is now referred to as "Connectivity-based Fixel Enhancement (CFE)". + (this is now referred to as "Connectivity-based Fixel Enhancement (CFE)"). During the presentation itself, the term 'dixel' was used to refer to a specific direction within a specific voxel; but a direction that corresponds to a particular fible bundle in that voxel. You may observe @@ -152,4 +153,5 @@ Some observations / contexts in which the term 'dixel' may be useful: here as a 'fixel', rather than a 'dixel'; this is because at the time when this presentation was made, these two terms had not yet been disambiguated. The definitions made within this documentation page are - what will be used from now on by the *MRtrix3* developers. + what will be used from now on by the *MRtrix3* developers; and we hope + by the wider community as well. From 30616f5ebec07df7ecdfaeffb5fe473810f6f321 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 23 Aug 2017 10:09:51 +1000 Subject: [PATCH 084/538] Docs: Rename "Hanging and crashing" page This page is not "Crashes, errors and performance issues". In addition, some entries that were duplicated between two pages were removed, and some pages from FAQs have been moved into this page. --- .../common_fba_steps/statistics.rst | 2 +- docs/index.rst | 5 +- docs/troubleshooting/FAQ.rst | 103 ++------------ .../compiler_error_during_build.rst | 22 --- docs/troubleshooting/display_issues.rst | 22 +-- ...ashing.rst => performance_and_crashes.rst} | 129 +++++++++++++----- 6 files changed, 112 insertions(+), 171 deletions(-) delete mode 100644 docs/troubleshooting/compiler_error_during_build.rst rename docs/troubleshooting/{hanging_or_crashing.rst => performance_and_crashes.rst} (80%) diff --git a/docs/fixel_based_analysis/common_fba_steps/statistics.rst b/docs/fixel_based_analysis/common_fba_steps/statistics.rst index 19d65c9ca9..4a4e11c5ec 100644 --- a/docs/fixel_based_analysis/common_fba_steps/statistics.rst +++ b/docs/fixel_based_analysis/common_fba_steps/statistics.rst @@ -6,4 +6,4 @@ Statistical analysis is performed using `connectivity-based fixel enhancement `__. +If you are seeking an answer to a question that specifically relates to +*MRtrix3* performance issues or crashes, please check the `relevant +documentation page `__. + + Processing of HCP data ---------------------- @@ -56,7 +63,7 @@ assumption. To me, there are two possible ways that this could be handled: - Generate a representation of the response function that can be interpolated / extrapolated as a function of b-value, and therefore choose an appropriate - response function per voxel. + response function per voxel. Work is underway to solve these issues, but there's nothing available yet. For those wanting to pursue their own solution, bear in mind that the gradient @@ -106,6 +113,7 @@ Apply the mask: $ mrcalc temp.mif mask.mif -mult TWFC.mif + Handling SIFT2 weights ---------------------- @@ -155,6 +163,7 @@ that must be *explicitly* provided to any commands in order to be used. The track file can also be used *without* taking into account the streamline weights, simply by *not* providing the weights. + Making use of Python scripts library ------------------------------------ @@ -181,6 +190,7 @@ location of those libraries; e.g.: (Replace the path to the *MRtrix3* "lib" directory with the location of your own installation) + ``tck2connectome`` no longer has the ``-contrast X`` option...? ------------------------------------------------------------------------- @@ -231,7 +241,7 @@ old usage. Visualising streamlines terminations -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +------------------------------------ I am frequently asked about Figures 5-7 in the `Anatomically-Constrained Tractography `__ @@ -290,92 +300,3 @@ used in these figures, which I'll explain here in full. screenshot by 180 degrees: this provides a pseudo-random coloring of the termination points that contrasts well against the tracks. - -Compiler error during build ---------------------------- - -If you encounter an error during the build process that resembles the following: - -.. code-block:: text - - ERROR: (#/#) [CC] release/cmd/command.o - - /usr/bin/g++-4.8 -c -std=c++11 -pthread -fPIC -I/home/user/mrtrix3/eigen -Wall -O2 -DNDEBUG -Isrc -Icmd -I./lib -Icmd cmd/command.cpp -o release/cmd/command.o - - failed with output - - g++-4.8: internal compiler error: Killed (program cc1plus) - Please submit a full bug report, - with preprocessed source if appropriate. - See for instructions. - - -This is most typically caused by the compiler running out of RAM. This -can be solved either through installing more RAM into your system, or -by restricting the number of threads to be used during compilation: - -.. code-block:: console - - $ NUMBER_OF_PROCESSORS=1 ./build - - - -Hanging on network file system when writing images --------------------------------------------------- - -When any *MRtrix3* command must read or write image data, there are two -primary mechanisms by which this is performed: - -1. `Memory mapping `_: -The operating system provides access to the contents of the file as -though it were simply a block of data in memory, without needing to -explicitly load all of the image data into RAM. - -2. Preload / delayed write-back: When opening an existing image, the -entire image contents are loaded into a block of RAM. If an image is -modified, or a new image created, this occurs entirely within RAM, with -the image contents written to disk storage only at completion of the -command. - -This design ensures that loading images for processing is as fast as -possible and does not incur unnecessary RAM requirements, and writing -files to disk is as efficient as possible as all data is written as a -single contiguous block. - -Memory mapping will be used wherever possible. However one circumstance -where this should *not* be used is when *write access* is required for -the target file, and it is stored on a *network file system*: in this -case, the command typically slows to a crawl (e.g. progressbar stays at -0% indefinitely), as the memory-mapping implementation repeatedly -performs small data writes and attempts to keep the entire image data -synchronised. - -*MRtrix3* will now *test* the type of file system that a target image is -stored on; and if it is a network-based system, it will *not* use -memory-mapping for images that may be written to. *However*, if you -experience the aforementioned slowdown in such a circumstance, it is -possible that the particular configuration you are using is not being -correctly detected or identified. If you are unfortunate enough to -encounter this issue, please report to the developers the hardware -configuration and file system type in use. - -Linux: very slow performance when writing large images ------------------------------------------------------- -This might be due to the Linux Disk Caching or the kernel's handling of `dirty -pages -`__. - -On Ubuntu, you can get your current dirty page handling settings with ``sysctl -a | grep dirty``. -Those settings can be modified in ``/etc/sysctl.conf`` by adding the following -two lines to ``/etc/sysctl.conf``: - -.. code-block:: text - - vm.dirty_background_ratio = 60 - vm.dirty_ratio = 80 - -``vm.dirty_background_ratio`` is a percentage fraction of your RAM and should -be larger than the image to be written. After changing ``/etc/sysctl.conf``, -execute ``sysctl -p`` to configure the new kernel parameters at runtime. -Depending on your system, these changes might not be persistent after reboot. - diff --git a/docs/troubleshooting/compiler_error_during_build.rst b/docs/troubleshooting/compiler_error_during_build.rst deleted file mode 100644 index 8567ca9e75..0000000000 --- a/docs/troubleshooting/compiler_error_during_build.rst +++ /dev/null @@ -1,22 +0,0 @@ -Compiler error during build -=========================== - -If you encounter an error during the build process that resembles the following:: - - ERROR: (#/#) [CC] release/cmd/command.o - - /usr/bin/g++-4.8 -c -std=c++11 -pthread -fPIC -I/home/user/mrtrix3/eigen -Wall -O2 -DNDEBUG -Isrc -Icmd -I./lib -Icmd cmd/command.cpp -o release/cmd/command.o - - failed with output - - g++-4.8: internal compiler error: Killed (program cc1plus) - Please submit a full bug report, - with preprocessed source if appropriate. - See for instructions. - - -This is most typically caused by the compiler running out of RAM. This -can be solved either through installing more RAM into your system, or -by restricting the number of threads to be used during compilation:: - - NUMBER_OF_PROCESSORS=1 ./build diff --git a/docs/troubleshooting/display_issues.rst b/docs/troubleshooting/display_issues.rst index aa43fc2a42..a167ccffaa 100644 --- a/docs/troubleshooting/display_issues.rst +++ b/docs/troubleshooting/display_issues.rst @@ -1,9 +1,9 @@ -.. _remote_display: - Display issues ============== +.. _remote_display: + Remote display issues --------------------- @@ -193,7 +193,7 @@ manifest in many ways, but the two most obvious one are: Unusual symbols on terminal -=========================== +--------------------------- When running *MRtrix3* commands on certain terminal emulators, you may see unusual characters appearing in the terminal output, that look something @@ -231,19 +231,3 @@ system-wide or user config file to disable these advanced terminal features: TerminalColor: 0 - - -Conflicts with previous versions of Qt --------------------------------------- - -If previous versions of Qt were already installed on the system, they -can sometimes conflict with the installation of *MRtrix3*. This can -manifest in many ways, but the two most obvious one are: - -- ``./configure`` reports using the older version, but ``./build`` - completes without errors. However, MRView crashes, complaining about - OpenGL version not being sufficient. -- ``./configure`` reports the correct version of Qt, but ``./build`` - fails with various error messages (typically related to redefined - macros, with previous definitions elsewhere in the code). - diff --git a/docs/troubleshooting/hanging_or_crashing.rst b/docs/troubleshooting/performance_and_crashes.rst similarity index 80% rename from docs/troubleshooting/hanging_or_crashing.rst rename to docs/troubleshooting/performance_and_crashes.rst index 5e67f58434..3a2e66486c 100644 --- a/docs/troubleshooting/hanging_or_crashing.rst +++ b/docs/troubleshooting/performance_and_crashes.rst @@ -1,47 +1,44 @@ -Hanging or Crashing -=================== +Crashes, errors and performance issues +====================================== +Throughout *MRtrix3* we try to provide users with meaningful error messages +if something does not work or sensible default behaviour cannot be determined. +However in some cases, feedback to the user can be unavoidably difficult to +interpret, or non-existent in cases where performance is poor but a command +does not fail outright; this page is a collection of information of such +cases. -Hanging on network file system when writing images --------------------------------------------------- -When any *MRtrix3* command must read or write image data, there are two -primary mechanisms by which this is performed: +Compiler error during build +--------------------------- -1. `Memory mapping `_: -The operating system provides access to the contents of the file as -though it were simply a block of data in memory, without needing to -explicitly load all of the image data into RAM. +If you encounter an error during the build process that resembles the following: -2. Preload / delayed write-back: When opening an existing image, the -entire image contents are loaded into a block of RAM. If an image is -modified, or a new image created, this occurs entirely within RAM, with -the image contents written to disk storage only at completion of the -command. +.. code-block:: text -This design ensures that loading images for processing is as fast as -possible and does not incur unnecessary RAM requirements, and writing -files to disk is as efficient as possible as all data is written as a -single contiguous block. + ERROR: (#/#) [CC] release/cmd/command.o -Memory mapping will be used wherever possible. However one circumstance -where this should *not* be used is when *write access* is required for -the target file, and it is stored on a *network file system*: in this -case, the command typically slows to a crawl (e.g. progressbar stays at -0% indefinitely), as the memory-mapping implementation repeatedly -performs small data writes and attempts to keep the entire image data -synchronised. + /usr/bin/g++-4.8 -c -std=c++11 -pthread -fPIC -I/home/user/mrtrix3/eigen -Wall -O2 -DNDEBUG -Isrc -Icmd -I./lib -Icmd cmd/command.cpp -o release/cmd/command.o -*MRtrix3* will now *test* the type of file system that a target image is -stored on; and if it is a network-based system, it will *not* use -memory-mapping for images that may be written to. *However*, if you -experience the aforementioned slowdown in such a circumstance, it is -possible that the particular configuration you are using is not being -correctly detected or identified. If you are unfortunate enough to -encounter this issue, please report to the developers the hardware -configuration and file system type in use. + failed with output + + g++-4.8: internal compiler error: Killed (program cc1plus) + Please submit a full bug report, + with preprocessed source if appropriate. + See for instructions. +This is most typically caused by the compiler running out of RAM. This +can be solved either through installing more RAM into your system, or +by restricting the number of threads to be used during compilation: + +.. code-block:: console + + $ NUMBER_OF_PROCESSORS=1 ./build + + +.. _crash_RAM: + Commands crashing due to memory requirements -------------------------------------------- @@ -92,7 +89,7 @@ For CFE, it is the resolution of the *population template image* that affects the memory usage; however using higher-resolution images for registration when *generating* that population template may still be beneficial. Therefore we advocate downsampling the population template image after its generation, -and otherwise proceed with FIxel-Based Analysis (FBA) using this down-sampled +and otherwise proceed with Fixel-Based Analysis (FBA) using this down-sampled template image. @@ -148,6 +145,68 @@ A few pointers for anybody who encounters this issue: one script crashed when other scripts have completed successfully. +Hanging on network file system when writing images +-------------------------------------------------- + +When any *MRtrix3* command must read or write image data, there are two +primary mechanisms by which this is performed: + +1. `Memory mapping `_: +The operating system provides access to the contents of the file as +though it were simply a block of data in memory, without needing to +explicitly load all of the image data into RAM. + +2. Preload / delayed write-back: When opening an existing image, the +entire image contents are loaded into a block of RAM. If an image is +modified, or a new image created, this occurs entirely within RAM, with +the image contents written to disk storage only at completion of the +command. + +This design ensures that loading images for processing is as fast as +possible and does not incur unnecessary RAM requirements, and writing +files to disk is as efficient as possible as all data is written as a +single contiguous block. + +Memory mapping will be used wherever possible. However one circumstance +where this should *not* be used is when *write access* is required for +the target file, and it is stored on a *network file system*: in this +case, the command typically slows to a crawl (e.g. progressbar stays at +0% indefinitely), as the memory-mapping implementation repeatedly +performs small data writes and attempts to keep the entire image data +synchronised. + +*MRtrix3* will now *test* the type of file system that a target image is +stored on; and if it is a network-based system, it will *not* use +memory-mapping for images that may be written to. *However*, if you +experience the aforementioned slowdown in such a circumstance, it is +possible that the particular configuration you are using is not being +correctly detected or identified. If you are unfortunate enough to +encounter this issue, please report to the developers the hardware +configuration and file system type in use. + + +Linux: very slow performance when writing large images +------------------------------------------------------ + +This might be due to the Linux Disk Caching or the kernel's handling of `dirty +pages +`__. + +On Ubuntu, you can get your current dirty page handling settings with ``sysctl -a | grep dirty``. +Those settings can be modified in ``/etc/sysctl.conf`` by adding the following +two lines to ``/etc/sysctl.conf``: + +.. code-block:: text + + vm.dirty_background_ratio = 60 + vm.dirty_ratio = 80 + +``vm.dirty_background_ratio`` is a percentage fraction of your RAM and should +be larger than the image to be written. After changing ``/etc/sysctl.conf``, +execute ``sysctl -p`` to configure the new kernel parameters at runtime. +Depending on your system, these changes might not be persistent after reboot. + + ``mrview`` unable to open images: "Too many open files" ------------------------------------------------------- From 89e918b40dcef67955f52bf9d0ec9ccfd2e9906f Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 23 Aug 2017 13:01:32 +1000 Subject: [PATCH 085/538] TravisCI: Incorporate documentation testing - Run sphinx-build on the docs/ directory, and ensure that the documentation compiles without any warnings or errors. - Run generate_user_docs.sh, and fail testing if the generated documentation files are not identical (i.e. the developer has forgotten to run this script, and hence a mismatch remains between the command-based help pages and the documentation reference pages). --- .travis.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index ab4826a12f..287c55a077 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,22 +9,28 @@ addons: - libqt4-opengl-dev - g++-4.8 - python3 + - python-sphinx + - python3-sphinx compiler: - clang env: - py=python2 - py=python3 -install: +install: - export NUMBER_OF_PROCESSORS=4 - - export PATH=`pwd`/release/bin:`pwd`/scripts:${PATH} + - export PATH=`pwd`/bin:${PATH} - export EIGEN_CFLAGS=-I`pwd`/../eigen - (cd ..; hg clone https://bitbucket.org/eigen/eigen/; cd eigen; hg update 3.3) script: + - /usr/share/sphinx/scripts/${py}/sphinx-build -n -N -W -w sphinx.log docs/ tmp/ - ./check_memalign && $py ./configure -assert && $py ./build -nowarnings && ./run_tests + - cd docs/ && ./generate_user_docs.sh && git diff --exitcode > gitdiff.log 2>&1 && cd ../ -after_failure: +after_failure: + - cat sphinx.log - cat memalign.log - cat configure.log - cat build.log - cat testing.log + - cat gitdiff.log - sleep 10 From 7503e4d07460d4e3e8751baa8a1d4ea977575bd4 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 23 Aug 2017 13:03:37 +1000 Subject: [PATCH 086/538] TravisCI: Fix path to log file for git diff call --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 287c55a077..0d7b4ad1fd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ install: script: - /usr/share/sphinx/scripts/${py}/sphinx-build -n -N -W -w sphinx.log docs/ tmp/ - ./check_memalign && $py ./configure -assert && $py ./build -nowarnings && ./run_tests - - cd docs/ && ./generate_user_docs.sh && git diff --exitcode > gitdiff.log 2>&1 && cd ../ + - cd docs/ && ./generate_user_docs.sh && git diff --exitcode > ../gitdiff.log 2>&1 && cd ../ after_failure: - cat sphinx.log From 48bea9e7acc4283ae285a58bbcdb4fe198d3f638 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 23 Aug 2017 14:39:30 +1000 Subject: [PATCH 087/538] TravisCI: Attempt to fix documentation testing - Install recommonmark through pip, as it is a prerequisite for sphinx. - Exclude documentation pages for mrview and shview from the git diff test, since these cannot be executed within the CI environment. --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0d7b4ad1fd..a32348bfdf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,9 @@ addons: - libqt4-opengl-dev - g++-4.8 - python3 + - python-pip - python-sphinx + - python3-pip - python3-sphinx compiler: - clang @@ -21,10 +23,12 @@ install: - export PATH=`pwd`/bin:${PATH} - export EIGEN_CFLAGS=-I`pwd`/../eigen - (cd ..; hg clone https://bitbucket.org/eigen/eigen/; cd eigen; hg update 3.3) + - pip install recommonmark + - pip3 install recommonmark script: - /usr/share/sphinx/scripts/${py}/sphinx-build -n -N -W -w sphinx.log docs/ tmp/ - ./check_memalign && $py ./configure -assert && $py ./build -nowarnings && ./run_tests - - cd docs/ && ./generate_user_docs.sh && git diff --exitcode > ../gitdiff.log 2>&1 && cd ../ + - cd docs/ && ./generate_user_docs.sh && cd ../ && git diff --exit-code -- . ':(exclude)docs/reference/commands/mrview.rst' ':(exclude)docs/reference/commands/shview.rst' > ../gitdiff.log 2>&1 after_failure: - cat sphinx.log From e2e654c3b41ece5dba6a7d128a3181c089afb9a2 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Wed, 23 Aug 2017 15:19:30 +1000 Subject: [PATCH 088/538] lmax to concepts, applies beyond CSD --- ...mal_basis.rst => orthonormal_sh_basis.rst} | 19 +++++++++---------- .../lmax.rst => concepts/sh_basis_lmax.rst} | 0 docs/index.rst | 4 ++-- 3 files changed, 11 insertions(+), 12 deletions(-) rename docs/concepts/{orthonormal_basis.rst => orthonormal_sh_basis.rst} (89%) rename docs/{constrained_spherical_deconvolution/lmax.rst => concepts/sh_basis_lmax.rst} (100%) diff --git a/docs/concepts/orthonormal_basis.rst b/docs/concepts/orthonormal_sh_basis.rst similarity index 89% rename from docs/concepts/orthonormal_basis.rst rename to docs/concepts/orthonormal_sh_basis.rst index 9650276f6f..6323615ae8 100644 --- a/docs/concepts/orthonormal_basis.rst +++ b/docs/concepts/orthonormal_sh_basis.rst @@ -1,17 +1,16 @@ Orthonormal Spherical Harmonic basis ==================================== -An important change between the old and new versions of MRtrix is a -modification to the Spherical Harmonic (SH) basis functions. This change -has important consequences in terms of data that were generated prior to -the user changing to the new version, or any data that may be used +An important difference between the old (0.2.x) and new (0.3.x and 3.x.x) +versions of MRtrix is a change to the Spherical Harmonic (SH) basis +functions. This change has important consequences for data that may be used interchangeably between the two versions. **Important:** note that although it is possible to use and display FODs generated using MRtrix 0.2.x in the newer *MRtrix3* applications (and vice-versa), the FODs will *NOT* be correct. Moreover, it is very -difficult to tell the difference on simple visual inspection - the FODs -will still *look* reasonable, but will give incorrect results if used +difficult to tell the difference by simple visual inspection - the FODs +may still *look* reasonable, but will give incorrect results if used for tractography or in quantitative analyses. To ensure your images are correct, you should use the :ref:`shbasis` application included in *MRtrix3*, as described below. @@ -35,7 +34,7 @@ was a 'bug' in the SH basis functions. Mathematically, the basis was just appreciate that the formulation of this mathematical basis was not optimal. -Now this 'bug' didn't actually cause any problems; the previous version +This 'bug' didn't actually cause any problems; the previous version of MRtrix was self-consistent in its handling of the issue throughout the code. It was annoying for any users transferring data between MRtrix and other packages though. For the release of the new *MRtrix3*, we have @@ -80,10 +79,10 @@ image data on *all* systems that you use, and run harmonic data (only FOD images; raw DWIs / response functions / TDIs / etc. do not need to be converted). -Also: Remember I said that data previously generated will not be +Also: Remember that data previously generated will not be interpreted correctly by *MRtrix3* commands without the SH basis -conversion? The same applies in the other direction. So if you load FOD -images that have either been generated using *MRtrix*, or have +conversion? The same applies in the other direction. So if you load +FOD images that have either been generated using *MRtrix*, or have been previously converted using ``shbasis``, commands from the previous version of MRtrix (0.2) won't interpret them correctly. We hope that once we have feature completeness in *MRtrix3*, the old version diff --git a/docs/constrained_spherical_deconvolution/lmax.rst b/docs/concepts/sh_basis_lmax.rst similarity index 100% rename from docs/constrained_spherical_deconvolution/lmax.rst rename to docs/concepts/sh_basis_lmax.rst diff --git a/docs/index.rst b/docs/index.rst index 2c41d7ff51..15950b97fc 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -55,7 +55,6 @@ These applications have been written from scratch in C++, using the functionalit :caption: Constrained Spherical Deconvolution constrained_spherical_deconvolution/response_function_estimation - constrained_spherical_deconvolution/lmax constrained_spherical_deconvolution/multi_tissue_csd .. toctree:: @@ -94,7 +93,8 @@ These applications have been written from scratch in C++, using the functionalit concepts/dw_scheme concepts/global_intensity_normalisation - concepts/orthonormal_basis + concepts/orthonormal_sh_basis + concepts/sh_basis_lmax concepts/fixels_dixels concepts/afd_connectivity From 23ff3a842fd69fb8ced75d46a5327221e0666524 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 23 Aug 2017 15:40:19 +1000 Subject: [PATCH 089/538] generate_user_docs.sh: Support for running from another directory In addition, format_config_options writes its result to stdout rather than to file (generate_user_docs.sh was already trying to pipe the output of this comand to file). This simplifies TravisCI slightly by no longer having to change directories. --- .travis.yml | 2 +- docs/format_config_options | 3 +-- docs/generate_user_docs.sh | 26 +++++++++++++------------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index a32348bfdf..781311b996 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,7 @@ install: script: - /usr/share/sphinx/scripts/${py}/sphinx-build -n -N -W -w sphinx.log docs/ tmp/ - ./check_memalign && $py ./configure -assert && $py ./build -nowarnings && ./run_tests - - cd docs/ && ./generate_user_docs.sh && cd ../ && git diff --exit-code -- . ':(exclude)docs/reference/commands/mrview.rst' ':(exclude)docs/reference/commands/shview.rst' > ../gitdiff.log 2>&1 + - ./docs/generate_user_docs.sh && git diff --exit-code -- . ':(exclude)docs/reference/commands/mrview.rst' ':(exclude)docs/reference/commands/shview.rst' > gitdiff.log 2>&1 after_failure: - cat sphinx.log diff --git a/docs/format_config_options b/docs/format_config_options index 1bffab95d6..242d4d2c5a 100755 --- a/docs/format_config_options +++ b/docs/format_config_options @@ -28,5 +28,4 @@ for entry in optionlist: string += ' *' + entry[1] + '*\n\n' string += ' ' + entry[2] + '\n\n' -with open('reference/config_file_options.rst', 'w') as f: - f.write(string) +sys.stdout.write(string) diff --git a/docs/generate_user_docs.sh b/docs/generate_user_docs.sh index 7a9d7cd8e4..5be7528e04 100755 --- a/docs/generate_user_docs.sh +++ b/docs/generate_user_docs.sh @@ -21,10 +21,10 @@ export PATH=$mrtrix_root/bin:"$PATH" List of MRtrix3 commands ######################## -" > reference/commands_list.rst +" > ${mrtrix_root}/docs/reference/commands_list.rst - rm -rf reference/commands - mkdir -p reference/commands + rm -rf ${mrtrix_root}/docs/reference/commands + mkdir -p ${mrtrix_root}/docs/reference/commands toctree_file=$(mktemp) table_file=$(mktemp) @@ -40,8 +40,8 @@ List of MRtrix3 commands :header: \"Command\", \"Synopsis\" " > $table_file - for n in `find ../cmd/ -name "*.cpp" | sort`; do - dirpath='reference/commands' + for n in `find "${mrtrix_root}"/cmd/ -name "*.cpp" | sort`; do + dirpath=${mrtrix_root}'/docs/reference/commands' cppname=`basename $n` cmdname=${cppname%".cpp"} cmdpath=$cmdname @@ -53,7 +53,7 @@ List of MRtrix3 commands echo ' commands/'"$cmdname" >> $toctree_file echo ' :ref:`'"$cmdname"'`, "'`$cmdpath __print_synopsis__`'"' >> $table_file done - cat $toctree_file $table_file >> reference/commands_list.rst + cat $toctree_file $table_file >> ${mrtrix_root}/docs/reference/commands_list.rst rm -f $toctree_file $temp_file # Generating documentation for all scripts @@ -65,10 +65,10 @@ List of MRtrix3 commands List of MRtrix3 scripts ####################### -" > reference/scripts_list.rst +" > ${mrtrix_root}/docs/reference/scripts_list.rst - rm -rf reference/scripts - mkdir -p reference/scripts + rm -rf ${mrtrix_root}/docs/reference/scripts + mkdir -p ${mrtrix_root}/docs/reference/scripts toctree_file=$(mktemp) table_file=$(mktemp) @@ -84,8 +84,8 @@ List of MRtrix3 scripts :header: \"Command\", \"Synopsis\" " > $table_file - for n in `find ../bin/ -type f -print0 | xargs -0 grep -l "app.parse" | sort`; do - filepath='reference/scripts' + for n in `find "${mrtrix_root}"/bin/ -type f -print0 | xargs -0 grep -l "app.parse" | sort`; do + filepath=${mrtrix_root}'/docs/reference/scripts' filename=`basename $n` $n __print_usage_rst__ > $filepath/$filename.rst #sed -ie "1i$filename\n===========\n" $filepath/$filename.rst @@ -93,10 +93,10 @@ List of MRtrix3 scripts echo ' scripts/'"$filename" >> $toctree_file echo ' :ref:`'"$filename"'`, "'`$filename __print_synopsis__`'"' >> $table_file done - cat $toctree_file $table_file >> reference/scripts_list.rst + cat $toctree_file $table_file >> ${mrtrix_root}/docs/reference/scripts_list.rst rm -f $toctree_file $temp_file # Generating list of configuration file options - grep -rn --include=\*.h --include=\*.cpp '^\s*//CONF\b ' ../ | sed -ne 's/^.*CONF \(.*\)/\1/p' | ./format_config_options > reference/config_file_options.rst + grep -rn --include=\*.h --include=\*.cpp '^\s*//CONF\b ' "${mrtrix_root}" | sed -ne 's/^.*CONF \(.*\)/\1/p' | "${mrtrix_root}"/docs/format_config_options > ${mrtrix_root}/docs/reference/config_file_options.rst From 66777ec60fb2213e12b84d20cd6183e1f7bb51aa Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Wed, 23 Aug 2017 16:05:09 +1000 Subject: [PATCH 090/538] added dhollander response algo to quick msmt-csd tutorial I'm getting questions about this all the time, and the most convenient and accurate solution has always been to use this algorithm. If this for some very specific reason didn't work well, msmt_5tt didn't work either; and either the -fa parameter of dhollander could be tweaked for a good solution, or, worst case, manual selection of responses was the last resort. Offering a quick, convenient and accurate solution has always been my intention here, with the aim of multi-tissue csd to be more accessible, and hence to encourage its adoption. It's also good for the perception of msmt-csd that it produces a good quality output; which does depend on good quality responses, obtained without hassle. --- .../multi_shell_multi_tissue_csd.rst | 91 +++++++++++++++++++ .../multi_tissue_csd.rst | 87 ------------------ docs/index.rst | 2 +- docs/troubleshooting/FAQ.rst | 2 +- 4 files changed, 93 insertions(+), 89 deletions(-) create mode 100644 docs/constrained_spherical_deconvolution/multi_shell_multi_tissue_csd.rst delete mode 100644 docs/constrained_spherical_deconvolution/multi_tissue_csd.rst diff --git a/docs/constrained_spherical_deconvolution/multi_shell_multi_tissue_csd.rst b/docs/constrained_spherical_deconvolution/multi_shell_multi_tissue_csd.rst new file mode 100644 index 0000000000..7e176cc6f2 --- /dev/null +++ b/docs/constrained_spherical_deconvolution/multi_shell_multi_tissue_csd.rst @@ -0,0 +1,91 @@ +Multi-shell multi-tissue constrained spherical deconvolution +============================================================ + +Introduction +------------ + +Multi-Shell Multi-Tissue Constrained Spherical Deconvolution (MSMT-CSD) +exploits the unique b-value dependencies of the different macroscopic +tissue types (WM/GM/CSF) to estimate a multi-tissue orientation distribution +function (ODF) as explained in `Jeurissen et al. (2014) <#references>`__. +As it includes separate compartments for each tissue type, it can produce a map +of the WM/GM/CSF signal contributions directly from the DW data. In addition, +the more complete modelling of the DW signal results in more accurate apparent +fiber density (AFD) measures and more precise fibre orientation estimates +at the tissue interfaces. + +User guide +---------- + +Multi-shell multi-tissue CSD can be performed as: + +:: + + dwi2fod msmt_csd dwi.mif wm_response.txt wmfod.mif gm_response.txt gm.mif csf_response.txt csf.mif + +where + +- ``dwi.mif`` is the dwi data set (input) + +- ``_response.txt`` is the tissue-specific response function (input) + +- ``.mif`` is the tissue-specific ODF (output), typically full FODs for WM and a single scalars for GM and CSF + +Note that input response functions and their corresponding output ODFs need to be specified in pairs. + +Typically, you will also want to use the ``-mask`` option to avoid unnecessary computations in non-brain voxels: + +:: + + dwi2fod msmt_csd -mask mask.mif dwi.mif wm_response.txt wmfod.mif gm_response.txt gm.mif csf_response.txt csf.mif + +RGB tissue signal contribution maps can be obtained as follows: + +:: + + mrconvert -coord 3 0 wm.mif - | mrcat csf.mif gm.mif - vf.mif + +The resulting WM FODs can be displayed together with the tissue signal contribution map as: + +:: + + mrview vf.mif -odf.load_sh wm.mif + +Per tissue response function estimation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Input response functions for single-fibre WM, GM and CSF can be estimated directly from the data. +The most convenient way of doing so, is via the ``dwi2response dhollander`` algorithm +(`Dhollander et al. (2016) <#references>`__): + +:: + + dwi2response dhollander dwi.mif wm_response.txt gm_response.txt csf_response.txt + +where + +- ``dwi.mif`` is the same dwi data set as used above (input) + +- ``_response.txt`` is the tissue-specific response function as used above (output) + +Note that the order of the tissue responses output for this algorithm is always: WM, GM, CSF. + +Other methods exist, notably ``dwi2response msmt_5tt``, but this requires a co-registered T1 volume +and very accurate correction of EPI geometric distortions. (both up to sub-voxel accuracy) +Even then, still, ``dwi2response msmt_5tt`` may be less accurate than ``dwi2response dhollander`` +in a range of scenarios (`Dhollander et al. (2016) <#references>`__). + +References +---------- + +1. B. Jeurissen, J.D. Tournier, T. Dhollander, A. Connelly, and J. + Sijbers. *Multi-tissue constrained spherical deconvolution for + improved analysis of multi-shell diffusion MRI data.* NeuroImage, 103 + (2014), pp. 411–426 [`SD + link `__\ ] + +2. T. Dhollander, D. Raffelt, and A. Connelly. *Unsupervised 3-tissue response + function estimation from single-shell or multi-shell diffusion MR data without + a co-registered T1 image.* ISMRM Workshop on Breaking the Barriers of Diffusion MRI (2016), pp. 5 [`full text + link `__\ ] + diff --git a/docs/constrained_spherical_deconvolution/multi_tissue_csd.rst b/docs/constrained_spherical_deconvolution/multi_tissue_csd.rst deleted file mode 100644 index 8198dd8148..0000000000 --- a/docs/constrained_spherical_deconvolution/multi_tissue_csd.rst +++ /dev/null @@ -1,87 +0,0 @@ -Multi-tissue constrained spherical deconvolution -================================================ - -Introduction ------------- - -Multi-tissue constrained spherical deconvolution (CSD) of multi-shell data exploits the unique b-value dependencies of the different macroscopic tissue types (WM/GM/CSF) to estimate a multi-tissue orientation distribution function (ODF) as explained in `Jeurissen et al. (2014) <#references>`__. As it includes separate compartments for each tissue type, it can produce a map of the WM/GM/CSF signal contributions directly from the DW data. In addition, the more complete modelling of the DW signal results in more accurate apparent fiber density (AFD) measures and more precise fibre orientation estimates at the tissue interfaces. - -User guide ----------- - -Multi-tissue CSD can be performed as: - -:: - - dwi2fod msmt_csd dwi.mif wm.txt wm.mif gm.txt gm.mif csf.txt csf.mif - -where - -- ``dwi.mif`` is the dwi data set (input) - -- ``.txt`` is the tissue-specific response function (input) - -- ``.mif`` is the tissue-specific ODF (output) - -Note that input response functions and their corresponding output ODFs need to be specified in pairs. - -Typically, you will also want to use the ``-mask`` to avoid calculations in non-brain voxels: - -:: - - dwi2fod msmt_csd -mask mask.mif dwi.mif wm.txt wm.mif gm.txt gm.mif csf.txt csf.mif - -RGB tissue signal contribution maps can be obtained as follows: - -:: - - mrconvert -coord 3 0 wm.mif - | mrcat csf.mif gm.mif - vf.mif - -The resulting WM fODFs can be displayed together with the tissue signal contribution map as: - -:: - - mrview vf.mif -odf.load_sh wm.mif - -Per tissue response function estimation -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Input response functions for CSF, GM and single fibre WM can be estimated from the data using prior tissue segmentations, similarly to that described in `Jeurissen et al. (2014) <#references>`__ using the ``dwi2response msmt_5tt`` command: - -:: - - dwi2response msmt_5tt dwi.mif 5tt.mif wm.txt gm.txt csf.txt - -where - -- ``dwi.mif`` is the same dwi data set as used above (input) - -- ``5tt.mif`` is a tissue type segmentation of a coregistered T1 data set from the same subject (input) - -- ``.txt`` is the tissue-specific response function as used above (output) - -Prior tissue type segmentation can be obtained from a structural T1 scan using the `5ttgen` script: - -:: - - 5ttgen fsl T1.mif 5tt.mif - -where - -- ``T1.mif`` is a coregistered T1 data set from the same subject (input) - -- ``5tt.mif`` is the tissue type segmentation used above (output) - -The difference between the default behaviour of ``dwi2response msmt_5tt`` and the method described in `Jeurissen et al. (2014) <#references>`__ is that instead of selecting WM single-fibre voxels using an FA threshold, the ``dwi2response tournier`` algorithm is instead used. - -Note that this process is dependent on accurate correction of EPI geometric distortions, and rigid-body registration between the DWI and T1 modalities, such that the T1 image can be reliably used to select pure-tissue voxels in the DWI volumes. Failure to achieve these may result in inappropriate voxels being used for response function estimation, with concomitant errors in tissue estimates. - -References ----------- - -1. B. Jeurissen, J.D. Tournier, T. Dhollander, A. Connelly, and J. - Sijbers. *Multi-tissue constrained spherical deconvolution for - improved analysis of multi-shell diffusion MRI data.* NeuroImage, 103 - (2014), pp. 411–426 [`SD - link `__\ ] - diff --git a/docs/index.rst b/docs/index.rst index 15950b97fc..7802de20f6 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -55,7 +55,7 @@ These applications have been written from scratch in C++, using the functionalit :caption: Constrained Spherical Deconvolution constrained_spherical_deconvolution/response_function_estimation - constrained_spherical_deconvolution/multi_tissue_csd + constrained_spherical_deconvolution/multi_shell_multi_tissue_csd .. toctree:: :maxdepth: 1 diff --git a/docs/troubleshooting/FAQ.rst b/docs/troubleshooting/FAQ.rst index 71fe32d420..173c91be3a 100644 --- a/docs/troubleshooting/FAQ.rst +++ b/docs/troubleshooting/FAQ.rst @@ -49,7 +49,7 @@ The `Multi-Shell Multi-Tissue (MSMT) CSD `__ method has now been incorporated into *MRtrix3*, and is provided as part of the :ref:`dwi2fod` command. There are also instructions for its use provided in -the `documentation `__. +the `documentation `__. The image data include information on gradient non-linearities. Can I make use of this? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From 1cbf035ae14efe714017b1c6df399b2a37268a28 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Wed, 23 Aug 2017 16:18:04 +1000 Subject: [PATCH 091/538] small fix and addition --- .../multi_shell_multi_tissue_csd.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/constrained_spherical_deconvolution/multi_shell_multi_tissue_csd.rst b/docs/constrained_spherical_deconvolution/multi_shell_multi_tissue_csd.rst index 7e176cc6f2..c0a28a7955 100644 --- a/docs/constrained_spherical_deconvolution/multi_shell_multi_tissue_csd.rst +++ b/docs/constrained_spherical_deconvolution/multi_shell_multi_tissue_csd.rst @@ -71,7 +71,8 @@ where Note that the order of the tissue responses output for this algorithm is always: WM, GM, CSF. Other methods exist, notably ``dwi2response msmt_5tt``, but this requires a co-registered T1 volume -and very accurate correction of EPI geometric distortions. (both up to sub-voxel accuracy) +and very accurate correction of EPI geometric distortions (both up to sub-voxel accuracy), as well as +accurate segmentation of the T1 volume. Even then, still, ``dwi2response msmt_5tt`` may be less accurate than ``dwi2response dhollander`` in a range of scenarios (`Dhollander et al. (2016) <#references>`__). From 6d3529e8a398c54d09c0ccc555e5932d35fe3c95 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 23 Aug 2017 16:25:47 +1000 Subject: [PATCH 092/538] TravisCI: Use custom Sphinx conf.py file --- .travis.yml | 2 +- docs/fixel_based_analysis/common_fba_steps/statistics.rst | 2 +- docs/troubleshooting/hanging_or_crashing.rst | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 781311b996..4b4cf9a949 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ install: - pip install recommonmark - pip3 install recommonmark script: - - /usr/share/sphinx/scripts/${py}/sphinx-build -n -N -W -w sphinx.log docs/ tmp/ + - /usr/share/sphinx/scripts/${py}/sphinx-build -n -N -W -w sphinx.log -c docs/ docs/ tmp/ - ./check_memalign && $py ./configure -assert && $py ./build -nowarnings && ./run_tests - ./docs/generate_user_docs.sh && git diff --exit-code -- . ':(exclude)docs/reference/commands/mrview.rst' ':(exclude)docs/reference/commands/shview.rst' > gitdiff.log 2>&1 diff --git a/docs/fixel_based_analysis/common_fba_steps/statistics.rst b/docs/fixel_based_analysis/common_fba_steps/statistics.rst index 19d65c9ca9..cc4e5c1c8f 100644 --- a/docs/fixel_based_analysis/common_fba_steps/statistics.rst +++ b/docs/fixel_based_analysis/common_fba_steps/statistics.rst @@ -6,4 +6,4 @@ Statistical analysis is performed using `connectivity-based fixel enhancement Date: Wed, 23 Aug 2017 16:30:31 +1000 Subject: [PATCH 093/538] TravisCI: Install recommonmark via pip Trying to solve issue where sphinx is failing to find recommonmark, despite the latter having been explicitly installed. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4b4cf9a949..62636c1575 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,7 @@ addons: - g++-4.8 - python3 - python-pip - - python-sphinx - python3-pip - - python3-sphinx compiler: - clang env: @@ -24,7 +22,9 @@ install: - export EIGEN_CFLAGS=-I`pwd`/../eigen - (cd ..; hg clone https://bitbucket.org/eigen/eigen/; cd eigen; hg update 3.3) - pip install recommonmark + - pip install sphinx - pip3 install recommonmark + - pip3 install sphinx script: - /usr/share/sphinx/scripts/${py}/sphinx-build -n -N -W -w sphinx.log -c docs/ docs/ tmp/ - ./check_memalign && $py ./configure -assert && $py ./build -nowarnings && ./run_tests From 117b79437b627f3d30a69ddb352901043aae454d Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 23 Aug 2017 16:41:19 +1000 Subject: [PATCH 094/538] TravisCI: Fix sphinx invocation When installed through pip rather than apt-get, the sphinx-build command does not go to the same location. Moreover, there are not separate commands created for Python versions 2 and 3. Therefore, instead invoke sphinx through the relevant Python interpreter. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 62636c1575..9b20c11814 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ install: - pip3 install recommonmark - pip3 install sphinx script: - - /usr/share/sphinx/scripts/${py}/sphinx-build -n -N -W -w sphinx.log -c docs/ docs/ tmp/ + - ${py} -m sphinx -n -N -W -w sphinx.log -c docs/ docs/ tmp/ - ./check_memalign && $py ./configure -assert && $py ./build -nowarnings && ./run_tests - ./docs/generate_user_docs.sh && git diff --exit-code -- . ':(exclude)docs/reference/commands/mrview.rst' ':(exclude)docs/reference/commands/shview.rst' > gitdiff.log 2>&1 From f2fcd2f7fffed3141e6a168adf60d556243bfad5 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 23 Aug 2017 16:47:17 +1000 Subject: [PATCH 095/538] TravisCI: Also import sphinx-rtd-theme through pip This is a prerequisite for docs/conf.py. --- .travis.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9b20c11814..ea1e74f60d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,10 +21,8 @@ install: - export PATH=`pwd`/bin:${PATH} - export EIGEN_CFLAGS=-I`pwd`/../eigen - (cd ..; hg clone https://bitbucket.org/eigen/eigen/; cd eigen; hg update 3.3) - - pip install recommonmark - - pip install sphinx - - pip3 install recommonmark - - pip3 install sphinx + - pip install recommonmark sphinx sphinx-rtd-theme + - pip3 install recommonmark sphinx sphinx-rtd-theme script: - ${py} -m sphinx -n -N -W -w sphinx.log -c docs/ docs/ tmp/ - ./check_memalign && $py ./configure -assert && $py ./build -nowarnings && ./run_tests From 87dabc3312c2a0098c53d3bd1469c3f9647569bf Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 23 Aug 2017 17:30:47 +1000 Subject: [PATCH 096/538] TravisCI: Better detection of un-committed doc changes Since re-generation of the docs/reference/ contents within TravisCI will not correctly fill contents for GUI commands (mrview and shview), take steps to detect any un-committed changes outside of these two commands. This involves: - Skipping the files corresponding to these two commands. - Skipping changes to the file docs/reference/commands_list.rst that relate to the absence of command synopses for these commands. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ea1e74f60d..cbb7d4b118 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ install: script: - ${py} -m sphinx -n -N -W -w sphinx.log -c docs/ docs/ tmp/ - ./check_memalign && $py ./configure -assert && $py ./build -nowarnings && ./run_tests - - ./docs/generate_user_docs.sh && git diff --exit-code -- . ':(exclude)docs/reference/commands/mrview.rst' ':(exclude)docs/reference/commands/shview.rst' > gitdiff.log 2>&1 + - ./docs/generate_user_docs.sh && ! ( git diff -- . ':(exclude)docs/reference/commands/mrview.rst' ':(exclude)docs/reference/commands/shview.rst' | tee gitdiff.log | grep '^-\|^+' | grep -q -v 'commands_list.rst\|mrview\|shview' ) after_failure: - cat sphinx.log From 9872b4b22f369e39262fb8d85491d3fa31011087 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Wed, 23 Aug 2017 11:06:23 +0100 Subject: [PATCH 097/538] GUI commands: allow __print_synopsis__ and related options to run without a display --- core/app.cpp | 14 +++++++++----- core/app.h | 3 +++ core/command.h | 6 +++--- src/gui/gui.h | 1 - 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/core/app.cpp b/core/app.cpp index 66a9adf072..7fdde6f77e 100644 --- a/core/app.cpp +++ b/core/app.cpp @@ -888,12 +888,8 @@ namespace MR - - void parse () + void parse_special_options () { - argument.clear(); - option.clear(); - if (!AUTHOR) throw Exception ("No author specified for command " + std::string(NAME)); if (!SYNOPSIS) @@ -918,6 +914,14 @@ namespace MR } } + } + + + void parse () + { + argument.clear(); + option.clear(); + sort_arguments (argc, argv); if (get_options ("help").size()) { diff --git a/core/app.h b/core/app.h index 9b6877026d..11776198d0 100644 --- a/core/app.h +++ b/core/app.h @@ -147,6 +147,9 @@ namespace MR * processing takes place. */ void init (int argc, const char* const* argv); + //! option parsing that should happen before GUI creation [used internally] + void parse_special_options (); + //! do the actual parsing of the command-line [used internally] void parse (); diff --git a/core/command.h b/core/command.h index 5c8ce4f0aa..0980a0e95c 100644 --- a/core/command.h +++ b/core/command.h @@ -79,12 +79,12 @@ int main (int cmdline_argc, char** cmdline_argv) ::MR::App::project_version = MRTRIX_PROJECT_VERSION; #endif try { + ::MR::App::init (cmdline_argc, cmdline_argv); + usage (); + ::MR::App::parse_special_options(); #ifdef __gui_app_h__ ::MR::GUI::App app (cmdline_argc, cmdline_argv); -#else - ::MR::App::init (cmdline_argc, cmdline_argv); #endif - usage (); ::MR::App::parse (); run (); } diff --git a/src/gui/gui.h b/src/gui/gui.h index 2986686298..e3ee85fafd 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -61,7 +61,6 @@ namespace MR QLocale::setDefault(QLocale::c()); new QApplication (cmdline_argc, cmdline_argv); - ::MR::App::init (cmdline_argc, cmdline_argv); qApp->setAttribute (Qt::AA_DontCreateNativeWidgetSiblings); } From d3d2e286c4bbe9b2f61cbc63fda0ced9cf3f9d34 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 23 Aug 2017 21:01:57 +1000 Subject: [PATCH 098/538] TravisCI: Simplify docs update test Changes in 9872b4b permit generation of documentation for GUI-based commands even in headless environments; therefore all auto-generated documentation can be generated within CI and compared to the repository. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cbb7d4b118..b3b4caf2f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ install: script: - ${py} -m sphinx -n -N -W -w sphinx.log -c docs/ docs/ tmp/ - ./check_memalign && $py ./configure -assert && $py ./build -nowarnings && ./run_tests - - ./docs/generate_user_docs.sh && ! ( git diff -- . ':(exclude)docs/reference/commands/mrview.rst' ':(exclude)docs/reference/commands/shview.rst' | tee gitdiff.log | grep '^-\|^+' | grep -q -v 'commands_list.rst\|mrview\|shview' ) + - ./docs/generate_user_docs.sh && git diff --exit-code docs/ > gitdiff.log || echo "Documentation is not up to date; run docs/generate_user_docs.sh and commit changes" after_failure: - cat sphinx.log From 580ce27de5b71bf9a45d1e0accc8197d505bc1fb Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 24 Aug 2017 10:17:27 +1000 Subject: [PATCH 099/538] Tweaks to internal command initialisation - New function verify_usage() performs AUTHOR and SYNOPSIS non-empty check. - Remove default authorship from R command initialisation. - Remove DEBUG() call within ProgressBar::set_update_method(), since App::log_level will not yet be set. --- core/app.cpp | 42 +++++++++++--------- core/app.h | 21 +++++----- core/command.h | 87 +++++++++++++++++++++-------------------- core/exception.h | 15 ++++--- core/progressbar.cpp | 33 ++++++++-------- core/signal_handler.cpp | 8 ++-- 6 files changed, 106 insertions(+), 100 deletions(-) diff --git a/core/app.cpp b/core/app.cpp index 7fdde6f77e..d3816e8d0a 100644 --- a/core/app.cpp +++ b/core/app.cpp @@ -888,35 +888,39 @@ namespace MR - void parse_special_options () + void verify_usage () { if (!AUTHOR) throw Exception ("No author specified for command " + std::string(NAME)); if (!SYNOPSIS) throw Exception ("No synopsis specified for command " + std::string(NAME)); + } + - if (argc == 2) { - if (strcmp (argv[1], "__print_full_usage__") == 0) { - print (full_usage ()); - throw 0; - } - if (strcmp (argv[1], "__print_usage_markdown__") == 0) { - print (markdown_usage ()); - throw 0; - } - if (strcmp (argv[1], "__print_usage_rst__") == 0) { - print (restructured_text_usage ()); - throw 0; - } - if (strcmp (argv[1], "__print_synopsis__") == 0) { - print (SYNOPSIS); - throw 0; - } - } + void parse_special_options () + { + if (argc != 2) return; + if (strcmp (argv[1], "__print_full_usage__") == 0) { + print (full_usage ()); + throw 0; + } + if (strcmp (argv[1], "__print_usage_markdown__") == 0) { + print (markdown_usage ()); + throw 0; + } + if (strcmp (argv[1], "__print_usage_rst__") == 0) { + print (restructured_text_usage ()); + throw 0; + } + if (strcmp (argv[1], "__print_synopsis__") == 0) { + print (SYNOPSIS); + throw 0; + } } + void parse () { argument.clear(); diff --git a/core/app.h b/core/app.h index 11776198d0..55c2becbac 100644 --- a/core/app.h +++ b/core/app.h @@ -61,7 +61,7 @@ namespace MR std::string help_synopsis (int format); std::string help_tail (int format); std::string usage_syntax (int format); - + @@ -128,12 +128,12 @@ namespace MR - inline void check_overwrite (const std::string& name) + inline void check_overwrite (const std::string& name) { if (Path::exists (name) && !overwrite_files) { if (check_overwrite_files_func) check_overwrite_files_func (name); - else + else throw Exception ("output file \"" + name + "\" already exists (use -force option to force overwrite)"); } } @@ -147,6 +147,9 @@ namespace MR * processing takes place. */ void init (int argc, const char* const* argv); + //! verify that command's usage() function has set requisite fields [used internally] + void verify_usage (); + //! option parsing that should happen before GUI creation [used internally] void parse_special_options (); @@ -269,7 +272,7 @@ namespace MR * a paragraph to the description using the '+' operator, e.g.: * \code * void usage() { - * DESCRIPTION + * DESCRIPTION * + "This command can be used in lots of ways " * "and is very versatile." * @@ -292,7 +295,7 @@ namespace MR * ARGUMENTS * + Argument ("in", "the input image").type_image_in() * + Argument ("factor", "the factor to use in the analysis").type_float() - * + Argument ("out", "the output image").type_image_out(); + * + Argument ("out", "the output image").type_image_out(); * } * \endcode */ @@ -361,12 +364,12 @@ namespace MR * } * \endcode */ const vector get_options (const std::string& name); - - + + //! Returns the option value if set, and the default otherwise. /*! Returns the value of (the first occurence of) option \c name * or the default value provided as second argument. - * + * * Use: * \code * float arg1 = get_option_value("myopt", arg1_default); @@ -380,7 +383,7 @@ namespace MR T r = (opt.size()) ? opt[0][0] : default_value; return r; } - + //! convenience function provided mostly to ease writing Exception strings inline std::string operator+ (const char* left, const App::ParsedArgument& right) diff --git a/core/command.h b/core/command.h index 0980a0e95c..2f4e7fefe3 100644 --- a/core/command.h +++ b/core/command.h @@ -24,46 +24,46 @@ #ifdef MRTRIX_AS_R_LIBRARY -extern "C" void R_main (int* cmdline_argc, char** cmdline_argv) -{ - ::MR::App::build_date = __DATE__; +extern "C" void R_main (int* cmdline_argc, char** cmdline_argv) +{ + ::MR::App::build_date = __DATE__; #ifdef MRTRIX_PROJECT_VERSION ::MR::App::project_version = MRTRIX_PROJECT_VERSION; #endif - SET_MRTRIX_PROJECT_VERSION - ::MR::App::AUTHOR = "J-Donald Tournier (d.tournier@brain.org.au)"; - ::MR::App::DESCRIPTION.clear(); - ::MR::App::ARGUMENTS.clear(); - ::MR::App::OPTIONS.clear(); - try { - usage(); - ::MR::App::init (*cmdline_argc, cmdline_argv); - ::MR::App::parse (); - run (); - } - catch (MR::Exception& E) { - E.display(); - return; - } - catch (int retval) { - return; - } -} + SET_MRTRIX_PROJECT_VERSION + ::MR::App::DESCRIPTION.clear(); + ::MR::App::ARGUMENTS.clear(); + ::MR::App::OPTIONS.clear(); + try { + usage(); + ::MR::App::verify_usage(); + ::MR::App::init (*cmdline_argc, cmdline_argv); + ::MR::App::parse (); + run (); + } + catch (MR::Exception& E) { + E.display(); + return; + } + catch (int retval) { + return; + } +} -extern "C" void R_usage (char** output) -{ - ::MR::App::DESCRIPTION.clear(); - ::MR::App::ARGUMENTS.clear(); - ::MR::App::OPTIONS.clear(); - usage(); - std::string s = MR::App::full_usage(); - *output = new char [s.size()+1]; - strncpy(*output, s.c_str(), s.size()+1); +extern "C" void R_usage (char** output) +{ + ::MR::App::DESCRIPTION.clear(); + ::MR::App::ARGUMENTS.clear(); + ::MR::App::OPTIONS.clear(); + usage(); + std::string s = MR::App::full_usage(); + *output = new char [s.size()+1]; + strncpy(*output, s.c_str(), s.size()+1); } #else -int main (int cmdline_argc, char** cmdline_argv) +int main (int cmdline_argc, char** cmdline_argv) { #ifdef FLUSH_TO_ZERO // use gcc switches: -msse -mfpmath=sse -ffast-math @@ -74,28 +74,29 @@ int main (int cmdline_argc, char** cmdline_argv) mxcsr |= (1<<6); // denormals-are-zero _mm_setcsr (mxcsr); #endif - ::MR::App::build_date = __DATE__; + ::MR::App::build_date = __DATE__; #ifdef MRTRIX_PROJECT_VERSION ::MR::App::project_version = MRTRIX_PROJECT_VERSION; #endif try { - ::MR::App::init (cmdline_argc, cmdline_argv); - usage (); + ::MR::App::init (cmdline_argc, cmdline_argv); + usage (); + ::MR::App::verify_usage(); ::MR::App::parse_special_options(); #ifdef __gui_app_h__ ::MR::GUI::App app (cmdline_argc, cmdline_argv); #endif - ::MR::App::parse (); + ::MR::App::parse (); run (); - } + } catch (::MR::Exception& E) { - E.display(); + E.display(); return 1; - } - catch (int retval) { - return retval; - } - return 0; + } + catch (int retval) { + return retval; + } + return 0; } #endif diff --git a/core/exception.h b/core/exception.h index 53d64ab015..b4559de073 100644 --- a/core/exception.h +++ b/core/exception.h @@ -27,18 +27,17 @@ namespace MR { - namespace App + namespace App { extern int log_level; - extern std::string NAME; } - //! print primary output to stdout as-is. + //! print primary output to stdout as-is. /*! This function is intended for cases where the command's primary output is text, not * image data, etc. It is \e not designed for error or status reports: it * prints to stdout, whereas all reporting functions print to stderr. This is * to allow the output of the command to be used directly in text processing - * pipeline or redirected to file. + * pipeline or redirected to file. * \note the use of stdout is normally reserved for piping data files (or at * least their filenames) between MRtrix commands. This function should * therefore never be used in commands that produce output images, as the two @@ -48,10 +47,10 @@ namespace MR //! \cond skip - + // for internal use only - - inline void __print_stderr (const std::string& text) + + inline void __print_stderr (const std::string& text) { #ifdef MRTRIX_AS_R_LIBRARY REprintf (text.c_str()); @@ -61,7 +60,7 @@ namespace MR } //! \endcond - //! display error, warning, debug, etc. message to user + //! display error, warning, debug, etc. message to user /*! types are: 0: error; 1: warning; 2: additional information; 3: * debugging information; anything else: none. */ extern void (*report_to_user_func) (const std::string& msg, int type); diff --git a/core/progressbar.cpp b/core/progressbar.cpp index e62aa200bd..91ba951eca 100644 --- a/core/progressbar.cpp +++ b/core/progressbar.cpp @@ -40,11 +40,11 @@ namespace MR void display_func_terminal (ProgressInfo& p) { __need_newline = true; - if (p.multiplier) - __print_stderr (printf ("\r%s: [%3zu%%] %s%s" CLEAR_LINE_CODE, + if (p.multiplier) + __print_stderr (printf ("\r%s: [%3zu%%] %s%s" CLEAR_LINE_CODE, App::NAME.c_str(), p.value, p.text.c_str(), p.ellipsis.c_str())); else - __print_stderr (printf ("\r%s: [%s] %s%s" CLEAR_LINE_CODE, + __print_stderr (printf ("\r%s: [%s] %s%s" CLEAR_LINE_CODE, App::NAME.c_str(), busy[p.value%6], p.text.c_str(), p.ellipsis.c_str())); } @@ -52,10 +52,10 @@ namespace MR void done_func_terminal (ProgressInfo& p) { if (p.multiplier) - __print_stderr (printf ("\r%s: [100%%] %s" CLEAR_LINE_CODE "\n", + __print_stderr (printf ("\r%s: [100%%] %s" CLEAR_LINE_CODE "\n", App::NAME.c_str(), p.text.c_str())); else - __print_stderr (printf ("\r%s: [done] %s" CLEAR_LINE_CODE "\n", + __print_stderr (printf ("\r%s: [done] %s" CLEAR_LINE_CODE "\n", App::NAME.c_str(), p.text.c_str())); __need_newline = false; } @@ -77,16 +77,16 @@ namespace MR count = next_update_at = 0; if (count++ == next_update_at) { if (p.multiplier) { - __print_stderr (printf ("%s: [%3zu%%] %s%s\n", + __print_stderr (printf ("%s: [%3zu%%] %s%s\n", App::NAME.c_str(), p.value, p.text.c_str(), p.ellipsis.c_str()));; } else { - __print_stderr (printf ("%s: [%s] %s%s\n", + __print_stderr (printf ("%s: [%s] %s%s\n", App::NAME.c_str(), busy[p.value%6], p.text.c_str(), p.ellipsis.c_str())); } if (next_update_at) - next_update_at *= 2; - else + next_update_at *= 2; + else next_update_at = 1; } } @@ -95,7 +95,7 @@ namespace MR __need_newline = true; if (p.multiplier) { if (p.value == 0) { - __print_stderr (printf ("%s: %s%s [", + __print_stderr (printf ("%s: %s%s [", App::NAME.c_str(), p.text.c_str(), p.ellipsis.c_str()));; } else if (p.value%2 == 0) { @@ -104,7 +104,7 @@ namespace MR } else { if (p.value == 0) { - __print_stderr (printf ("%s: %s%s ", + __print_stderr (printf ("%s: %s%s ", App::NAME.c_str(), p.text.c_str(), p.ellipsis.c_str()));; } else if (!(p.value & (p.value-1))) { @@ -126,7 +126,7 @@ namespace MR } } else { - if (p.multiplier) + if (p.multiplier) __print_stderr (printf ("]\n")); else __print_stderr (printf (" done\n")); @@ -145,16 +145,15 @@ namespace MR - bool ProgressBar::set_update_method () + bool ProgressBar::set_update_method () { bool stderr_to_file = false; struct stat buf; - if (fstat (STDERR_FILENO, &buf)) { - DEBUG ("Unable to determine nature of stderr; assuming socket"); + if (fstat (STDERR_FILENO, &buf)) + // unable to determine nature of stderr; assuming socket stderr_to_file = false; - } - else + else stderr_to_file = S_ISREG (buf.st_mode); diff --git a/core/signal_handler.cpp b/core/signal_handler.cpp index 47865d7088..d9c532c4a2 100644 --- a/core/signal_handler.cpp +++ b/core/signal_handler.cpp @@ -18,7 +18,7 @@ #include #include -#include "exception.h" +#include "app.h" #include "file/path.h" #ifdef MRTRIX_WINDOWS @@ -85,7 +85,7 @@ namespace MR // Try to do a tempfile cleanup before printing the error, since the latter's not guaranteed to work... // Don't use File::unlink: may throw an exception - for (const auto& i : data) + for (const auto& i : data) ::unlink (i.c_str()); @@ -93,11 +93,11 @@ namespace MR const char* msg = nullptr; switch (i) { -#define __SIGNAL(SIG,MSG) case SIG: sig = #SIG; msg = MSG; break; +#define __SIGNAL(SIG,MSG) case SIG: sig = #SIG; msg = MSG; break; #include "signals.h" default: - sig = "UNKNOWN"; + sig = "UNKNOWN"; msg = "Unknown fatal system signal"; break; } From e81c2d720c289cc69496fb38a996a631719ad501 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 24 Aug 2017 12:36:52 +1000 Subject: [PATCH 100/538] mrtrix3.image: Terminate script on failure of certain functions --- lib/mrtrix3/image.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/mrtrix3/image.py b/lib/mrtrix3/image.py index 25934ed6c5..b4bc301556 100644 --- a/lib/mrtrix3/image.py +++ b/lib/mrtrix3/image.py @@ -28,6 +28,8 @@ def headerField(image_path, field): app.debug(result) else: app.console('Result: ' + result) + if proc.returncode: + app.error('Error trying to read header field \'' + field + '\' from image \'' + image_path + '\'') return result @@ -43,6 +45,8 @@ def headerKeyValue(image_path, key): result = result.rstrip().decode('utf-8') if app._verbosity > 1: app.console('Result: ' + result) + # Don't exit on error; let the calling function determine whether or not + # the absence of the key is an issue return result @@ -91,5 +95,7 @@ def statistic(image_path, statistic, mask_path = ''): result = result.rstrip().decode('utf-8') if app._verbosity > 1: app.console('Result: ' + result) + if proc.returncode: + app.error('Error trying to calculate statistic \'' + statistic + '\' from image \'' + image_path + '\'') return result From 35e39f7ae781b50447c32a08c7f033dc07543d61 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 24 Aug 2017 14:34:27 +1000 Subject: [PATCH 101/538] tckdfc: Move explanation of -backtrack option to DESCRIPTION --- cmd/tckdfc.cpp | 25 +++++++++++++------------ docs/reference/commands/tckdfc.rst | 6 ++++-- docs/reference/commands_list.rst | 2 +- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/cmd/tckdfc.cpp b/cmd/tckdfc.cpp index c6ccab4409..dd92088238 100644 --- a/cmd/tckdfc.cpp +++ b/cmd/tckdfc.cpp @@ -45,14 +45,14 @@ using namespace MR::DWI::Tractography::Mapping; -const char* windows[] = { "rectangle", "triangle", "cosine", "hann", "hamming", "lanczos", NULL }; +const char* windows[] = { "rectangle", "triangle", "cosine", "hann", "hamming", "lanczos", nullptr }; void usage () { AUTHOR = "Robert E. Smith (robert.smith@florey.edu.au)"; -SYNOPSIS = "Perform the Track-Weighted Dynamic Functional Connectivity (TW-dFC) method."; +SYNOPSIS = "Perform the Track-Weighted Dynamic Functional Connectivity (TW-dFC) method"; DESCRIPTION + "This command generates a Track-Weighted Image (TWI), where the " @@ -71,7 +71,16 @@ DESCRIPTION "The output image is a 4D image, with the same number of volumes as " "the input fMRI time series. For each volume, the contribution from " "each streamline is calculated based on a finite-width sliding time " - "window, centred at the timepoint corresponding to that volume."; + "window, centred at the timepoint corresponding to that volume." + + + "Note that the -backtrack option in this command is similar, but not precisely " + "equivalent, to back-tracking as can be used with Anatomically-Constrained " + "Tractography (ACT) in the tckgen command. However, here the feature does not " + "change the streamlines trajectories in any way; it simply enables detection of " + "the fact that the input fMRI image may not contain a valid timeseries underneath " + "the streamline endpoint, and where this occurs, searches from the streamline " + "endpoint inwards along the streamline trajectory in search of a valid " + "timeseries to sample from the input image."; ARGUMENTS + Argument ("tracks", "the input track file.").type_file_in() @@ -113,15 +122,7 @@ OPTIONS + Option ("backtrack", "if no valid timeseries is found at the streamline endpoint, back-track along " - "the streamline trajectory until a valid timeseries is found. \n" - "Note that this mechanism is similar, but not precisely equivalent, to" - "back-tracking as can be used with Anatomically-Constrained Tractography (ACT) " - "in the tckgen command. However, here the feature does not change the " - "streamlines trajectories in any way; it simply enables detection of the fact " - "that the input fMRI image may not contain a valid timeseries underneath the " - "streamline endpoint, and where this occurs, searches from the streamline " - "endpoint inwards along the streamline trajectory in search of a valid " - "timeseries to sample from the input image.") + "the streamline trajectory until a valid timeseries is found") + Option ("upsample", "upsample the tracks by some ratio using Hermite interpolation before mappipng \n" diff --git a/docs/reference/commands/tckdfc.rst b/docs/reference/commands/tckdfc.rst index 934d2d8a51..27ed13ff81 100644 --- a/docs/reference/commands/tckdfc.rst +++ b/docs/reference/commands/tckdfc.rst @@ -6,7 +6,7 @@ tckdfc Synopsis -------- -Perform the Track-Weighted Dynamic Functional Connectivity (TW-dFC) method. +Perform the Track-Weighted Dynamic Functional Connectivity (TW-dFC) method Usage -------- @@ -30,6 +30,8 @@ The output image can be generated in one of two ways (note that one of these two - "Dynamic" functional connectivity (-dynamic option): The output image is a 4D image, with the same number of volumes as the input fMRI time series. For each volume, the contribution from each streamline is calculated based on a finite-width sliding time window, centred at the timepoint corresponding to that volume. +Note that the -backtrack option in this command is similar, but not precisely equivalent, to back-tracking as can be used with Anatomically-Constrained Tractography (ACT) in the tckgen command. However, here the feature does not change the streamlines trajectories in any way; it simply enables detection of the fact that the input fMRI image may not contain a valid timeseries underneath the streamline endpoint, and where this occurs, searches from the streamline endpoint inwards along the streamline trajectory in search of a valid timeseries to sample from the input image. + Options ------- @@ -52,7 +54,7 @@ Options for setting the properties of the output image Other options for affecting the streamline sampling & mapping behaviour ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-backtrack** if no valid timeseries is found at the streamline endpoint, back-track along the streamline trajectory until a valid timeseries is found. Note that this mechanism is similar, but not precisely equivalent, toback-tracking as can be used with Anatomically-Constrained Tractography (ACT) in the tckgen command. However, here the feature does not change the streamlines trajectories in any way; it simply enables detection of the fact that the input fMRI image may not contain a valid timeseries underneath the streamline endpoint, and where this occurs, searches from the streamline endpoint inwards along the streamline trajectory in search of a valid timeseries to sample from the input image. +- **-backtrack** if no valid timeseries is found at the streamline endpoint, back-track along the streamline trajectory until a valid timeseries is found - **-upsample factor** upsample the tracks by some ratio using Hermite interpolation before mappipng (if omitted, an appropriate ratio will be determined automatically) diff --git a/docs/reference/commands_list.rst b/docs/reference/commands_list.rst index 797dbffb6d..85ef447e10 100644 --- a/docs/reference/commands_list.rst +++ b/docs/reference/commands_list.rst @@ -203,7 +203,7 @@ List of MRtrix3 commands :ref:`tck2connectome`, "Generate a connectome matrix from a streamlines file and a node parcellation image" :ref:`tck2fixel`, "Compute a fixel TDI map from a tractogram" :ref:`tckconvert`, "Convert between different track file formats" - :ref:`tckdfc`, "Perform the Track-Weighted Dynamic Functional Connectivity (TW-dFC) method." + :ref:`tckdfc`, "Perform the Track-Weighted Dynamic Functional Connectivity (TW-dFC) method" :ref:`tckedit`, "Perform various editing operations on track files" :ref:`tckgen`, "Perform streamlines tractography" :ref:`tckglobal`, "Multi-Shell Multi-Tissue Global Tractography" From 7c6b2937aaf56b86f5b3eedae6a3faf36bab5533 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 24 Aug 2017 14:50:26 +1000 Subject: [PATCH 102/538] tckmap: Remove erroneous references to ends_corr track-wise statistic While this still exists in the back-end code for the sake of the tckdfc command, the functionaity should no longer be possible to access from the tckmap interface. --- cmd/tckmap.cpp | 12 ++---------- docs/reference/commands/tckmap.rst | 2 +- docs/reference/commands_list.rst | 4 ++-- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/cmd/tckmap.cpp b/cmd/tckmap.cpp index 3dc26fe281..556c81c609 100644 --- a/cmd/tckmap.cpp +++ b/cmd/tckmap.cpp @@ -129,8 +129,7 @@ const OptionGroup TWIOption = OptionGroup ("Options for the TWI image contrast p + Option ("backtrack", "when using -stat_tck ends_*, if the streamline endpoint is outside the FoV, backtrack along " - "the streamline trajectory until an appropriate point is found " - "(note: with -stat_tck ends_corr, this will also look for a valid time-series)"); + "the streamline trajectory until an appropriate point is found"); @@ -415,13 +414,7 @@ void run () { case SCALAR_MAP: case SCALAR_MAP_COUNT: - break; - case FOD_AMP: - if (stat_tck == ENDS_CORR) - throw Exception ("Can't use endpoint-correlation track-wise statistic with FOD_AMP contrast"); - break; - case CURVATURE: break; @@ -553,8 +546,7 @@ void run () { case ENDS_MEAN: msg += "endpoints (mean)"; break; case ENDS_MAX: msg += "endpoints (maximum)"; break; case ENDS_PROD: msg += "endpoints (product)"; break; - case ENDS_CORR: msg += "endpoints (correlation)"; break; - default: msg += "ERROR"; break; + default: throw Exception ("Invalid track-wise statistic detected"); } msg += " per-track statistic"; } diff --git a/docs/reference/commands/tckmap.rst b/docs/reference/commands/tckmap.rst index 37ed91e9aa..a6f14008f5 100644 --- a/docs/reference/commands/tckmap.rst +++ b/docs/reference/commands/tckmap.rst @@ -61,7 +61,7 @@ Options for the TWI image contrast properties - **-map_zero** if a streamline has zero contribution based on the contrast & statistic, typically it is not mapped; use this option to still contribute to the map even if this is the case (these non-contributing voxels can then influence the mean value in each voxel of the map) -- **-backtrack** when using -stat_tck ends_*, if the streamline endpoint is outside the FoV, backtrack along the streamline trajectory until an appropriate point is found (note: with -stat_tck ends_corr, this will also look for a valid time-series) +- **-backtrack** when using -stat_tck ends_*, if the streamline endpoint is outside the FoV, backtrack along the streamline trajectory until an appropriate point is found Options for the streamline-to-voxel mapping mechanism ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/reference/commands_list.rst b/docs/reference/commands_list.rst index a358782e1d..416e050f87 100644 --- a/docs/reference/commands_list.rst +++ b/docs/reference/commands_list.rst @@ -100,8 +100,8 @@ List of MRtrix3 commands commands/tcknormalise commands/tckresample commands/tcksample - commands/tcksift commands/tcksift2 + commands/tcksift commands/tckstats commands/tensor2metric commands/transformcalc @@ -212,8 +212,8 @@ List of MRtrix3 commands :ref:`tcknormalise`, "Apply a normalisation map to a tracks file" :ref:`tckresample`, "Resample each streamline in a track file to a new set of vertices" :ref:`tcksample`, "Sample values of an associated image along tracks" - :ref:`tcksift`, "Filter a whole-brain fibre-tracking data set such that the streamline densities match the FOD lobe integrals" :ref:`tcksift2`, "Successor to the SIFT method; instead of removing streamlines, use an EM framework to find an appropriate cross-section multiplier for each streamline" + :ref:`tcksift`, "Filter a whole-brain fibre-tracking data set such that the streamline densities match the FOD lobe integrals" :ref:`tckstats`, "Calculate statistics on streamlines length" :ref:`tensor2metric`, "Generate maps of tensor-derived parameters" :ref:`transformcalc`, "Perform calculations on linear transformation matrices" From be0037b21e192d25971f0618a818c79eaefbd82e Mon Sep 17 00:00:00 2001 From: Rami Tabbara Date: Thu, 24 Aug 2017 16:02:54 +1000 Subject: [PATCH 103/538] mrview: tract_geom: Disable lighting as default * Still need to support config file option to alter geom default --- src/gui/mrview/tool/tractography/tractography.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/mrview/tool/tractography/tractography.cpp b/src/gui/mrview/tool/tractography/tractography.cpp index 874597ccc5..933dbea0b8 100644 --- a/src/gui/mrview/tool/tractography/tractography.cpp +++ b/src/gui/mrview/tool/tractography/tractography.cpp @@ -71,7 +71,7 @@ namespace MR line_thickness (MRTRIX_DEFAULT_LINE_THICKNESS), point_size (MRTRIX_DEFAULT_POINT_SIZE), do_crop_to_slab (true), - use_lighting (true), + use_lighting (false), not_3D (true), line_opacity (1.0), scalar_file_options (nullptr), @@ -220,7 +220,7 @@ namespace MR lighting_group_box = new QGroupBox (tr("use lighting")); lighting_group_box->setCheckable (true); - lighting_group_box->setChecked (true); + lighting_group_box->setChecked (false); general_opt_grid->addWidget (lighting_group_box, 5, 0, 1, 2); connect (lighting_group_box, SIGNAL (clicked (bool)), this, SLOT (on_use_lighting_slot (bool))); From 02cb9bef923df29d1d39e4476ebe7ac07e9367b3 Mon Sep 17 00:00:00 2001 From: Rami Tabbara Date: Thu, 24 Aug 2017 17:56:57 +1000 Subject: [PATCH 104/538] mrview: tract_geom: Add default tract geom config option --- .../mrview/tool/tractography/tractogram.cpp | 3 +- src/gui/mrview/tool/tractography/tractogram.h | 4 +- .../mrview/tool/tractography/tractography.cpp | 54 ++++++++++++++----- 3 files changed, 47 insertions(+), 14 deletions(-) diff --git a/src/gui/mrview/tool/tractography/tractogram.cpp b/src/gui/mrview/tool/tractography/tractogram.cpp index 391731c0f7..2101e831f5 100644 --- a/src/gui/mrview/tool/tractography/tractogram.cpp +++ b/src/gui/mrview/tool/tractography/tractogram.cpp @@ -35,6 +35,7 @@ namespace MR namespace Tool { const int Tractogram::max_sample_stride; + TrackGeometryType Tractogram::default_tract_geom (TrackGeometryType::Pseudotubes); std::string Tractogram::Shader::vertex_shader_source (const Displayable& displayable) { @@ -351,7 +352,7 @@ namespace MR filename (filename), color_type (TrackColourType::Direction), threshold_type (TrackThresholdType::None), - geometry_type (TrackGeometryType::Pseudotubes), + geometry_type (default_tract_geom), sample_stride (0), vao_dirty (true), threshold_min (NaN), diff --git a/src/gui/mrview/tool/tractography/tractogram.h b/src/gui/mrview/tool/tractography/tractogram.h index 405d1dd668..d1eb838937 100644 --- a/src/gui/mrview/tool/tractography/tractogram.h +++ b/src/gui/mrview/tool/tractography/tractogram.h @@ -83,6 +83,8 @@ namespace MR float get_threshold_min() const { return threshold_min; } float get_threshold_max() const { return threshold_max; } + static TrackGeometryType default_tract_geom; + bool scalarfile_by_direction; bool show_colour_bar; bool should_update_stride; @@ -98,7 +100,7 @@ namespace MR use_lighting (false), color_type (TrackColourType::Direction), threshold_type (TrackThresholdType::None), - geometry_type (TrackGeometryType::Pseudotubes) { } + geometry_type (Tractogram::default_tract_geom) { } std::string vertex_shader_source (const Displayable&) override; std::string fragment_shader_source (const Displayable&) override; std::string geometry_shader_source (const Displayable&) override; diff --git a/src/gui/mrview/tool/tractography/tractography.cpp b/src/gui/mrview/tool/tractography/tractography.cpp index 933dbea0b8..e3965b24ba 100644 --- a/src/gui/mrview/tool/tractography/tractography.cpp +++ b/src/gui/mrview/tool/tractography/tractography.cpp @@ -35,6 +35,23 @@ namespace MR { namespace Tool { + TrackGeometryType index_to_geometry_type (const int idx) { + TrackGeometryType geom_type = TrackGeometryType::Pseudotubes; + + switch (idx) { + case 1: + geom_type = TrackGeometryType::Lines; + break; + case 2: + geom_type = TrackGeometryType::Points; + default: + break; + } + + return geom_type; + } + + class Tractography::Model : public ListModelBase { MEMALIGN(Tractography::Model) @@ -257,6 +274,30 @@ namespace MR connect (action, SIGNAL(triggered()), this, SLOT (colour_by_scalar_file_slot())); track_option_menu->addAction (action); + static const constexpr char* geom_config_options[] = { "Pseudotubes", "Lines", "Points", nullptr }; + + //CONF option: MRViewDefaultTractGeomType + //CONF default: Pseudotubes + //CONF The default geometry type used to render tractograms. + //CONF Options are Pseudotubes, Lines or Points + const std::string default_geom_type = File::Config::get ("MRViewDefaultTractGeomType", geom_config_options[0]); + + if (default_geom_type != geom_config_options[0]) { + int index (0); + if (default_geom_type == geom_config_options[1]) + index = 1; + else if (default_geom_type == geom_config_options[2]) + index = 2; + + // In the instance where pseudotubes are not the default, enable lighting + if (index) { + Tractogram::default_tract_geom = index_to_geometry_type (index); + use_lighting = true; + lighting_group_box->setChecked (true); + geom_type_combobox->setCurrentIndex (index); + } + } + update_geometry_type_gui(); } @@ -634,17 +675,7 @@ namespace MR void Tractography::geom_type_selection_slot(int selected_index) { - TrackGeometryType geom_type = TrackGeometryType::Pseudotubes; - - switch (selected_index) { - case 1: - geom_type = TrackGeometryType::Lines; - break; - case 2: - geom_type = TrackGeometryType::Points; - default: - break; - } + TrackGeometryType geom_type = index_to_geometry_type (selected_index); QModelIndexList indices = tractogram_list_view->selectionModel()->selectedIndexes(); for (int i = 0; i < indices.size(); ++i) @@ -770,7 +801,6 @@ namespace MR - void Tractography::add_commandline_options (MR::App::OptionList& options) { using namespace MR::App; From e748f74d105c3d90c09d353f25675e73627cd0b3 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Thu, 24 Aug 2017 13:59:31 +0100 Subject: [PATCH 105/538] docs: move ARCH discussion out of standalone packager This section about setting the CPU architecture was included in the standalone installer instructions due to the fact that we used to run with -march=native - this was likely to cause issues for this type of installation specifically. Now that the default is up to the compiler, there is no longer any reason for this section to be where it is. --- docs/installation/linux_install.rst | 35 +++++++++++++++-------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/docs/installation/linux_install.rst b/docs/installation/linux_install.rst index 330c8f8c62..887097e9c5 100644 --- a/docs/installation/linux_install.rst +++ b/docs/installation/linux_install.rst @@ -188,24 +188,8 @@ Keeping *MRtrix3* up to date and re-run step 1 again. -.. _linux_standalone: - -Standalone installation on Linux --------------------------------- - -In some cases, users need to install *MRtrix3* on systems running older -distributions, over which they have little or no control, for example -centrally-managed HPC clusters. In such cases, there genuinely is no way -to install the dependencies required to compile and run *MRtrix3*. There -are two ways to address this problem: `static -executables <#static-build>`__, and the `standalone -packager <#standalone-packager>`__. With both approaches, you can -compile *MRtrix3* on a modern distro (within a virtual machine for -example), package it up, and install it on any Linux system without -worrying about dependencies. - Setting the CPU architecture for optimal performance -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +---------------------------------------------------- By default, ``configure`` will cause the build script to produce generic code suitable for any current CPU. If you want to ensure optimal performance on your @@ -236,6 +220,23 @@ specifiers understood by the compiler `_, for example ``ARCH='sandybridge' ./configure`` + +.. _linux_standalone: + +Standalone installation on Linux +-------------------------------- + +In some cases, users need to install *MRtrix3* on systems running older +distributions, over which they have little or no control, for example +centrally-managed HPC clusters. In such cases, there genuinely is no way +to install the dependencies required to compile and run *MRtrix3*. There +are two ways to address this problem: `static +executables <#static-build>`__, and the `standalone +packager <#standalone-packager>`__. With both approaches, you can +compile *MRtrix3* on a modern distro (within a virtual machine for +example), package it up, and install it on any Linux system without +worrying about dependencies. + Static build ^^^^^^^^^^^^ From 517a8a44667b45315be02e0d87c72c4b9ba316b6 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Thu, 24 Aug 2017 14:58:06 +0100 Subject: [PATCH 106/538] docs: add page about software deployment --- docs/index.rst | 1 + docs/installation/deployment.rst | 88 +++++++++++++++++++++++++++++ docs/installation/linux_install.rst | 26 +-------- 3 files changed, 91 insertions(+), 24 deletions(-) create mode 100644 docs/installation/deployment.rst diff --git a/docs/index.rst b/docs/index.rst index 7802de20f6..bcc3780da1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -30,6 +30,7 @@ These applications have been written from scratch in C++, using the functionalit installation/linux_install installation/mac_install installation/windows_install + installation/deployment installation/hpc_clusters_install .. toctree:: diff --git a/docs/installation/deployment.rst b/docs/installation/deployment.rst new file mode 100644 index 0000000000..465a67f7e0 --- /dev/null +++ b/docs/installation/deployment.rst @@ -0,0 +1,88 @@ +.. _deployment: + +Deploying MRtrix3 +================= + +The installation instructions provided in the preceding pages produce a working +install for the current user only. There are many advantages to this: + +- no need for admin privileges, either for the initial install (beyond + installation of dependencies), or any subsequent updates; +- users are in control of the precise version of MRtrix3 they are using for + their specific projects - no system updates will interfere with their study. + +However, system administrators and software distributors will want to install +*MRtrix3* in a system-wide location to make it accessible to all users; and/or to +deploy it to other systems without requiring a full rebuild. While *MRtrix3* +does not provide an explicit command to do this, it is a trivial process: + +- build the code +- copy the ``bin/``, ``lib/`` and ``share/`` folders together to the desired + target location +- set the ``PATH`` to point to the ``bin/`` folder. + +This can be done any number of ways. The only requirement is that these 3 +folders are co-located alongside each other, so that the executables can find +the *MRtrix3* shared library, and the scripts can find the requisite python +modules. + +Note also that this structure is broadly compatible with the `Linux Filesystem +Hierarchy Standard `__. +It should be perfectly possible to merge the *MRtrix3* ``bin/``, ``lib/`` and +``share/`` folders with the system's existing equivalent locations in ``/usr/`` +or ``/usr/local/`` if desired, in which case there would be no need to +explicitly set the ``PATH`` (assuming ``/usr/bin`` or ``/usr/local/bin/`` are +already in the ``PATH``). However, there is no *requirement* that it be +installed anywhere in particular, and we expect most sysadmins will prefer to +place them in a separate location to minimise any chance of conflict. + +Below we provide step-by-step instructions for creating a single tar file that +can then be copied to other systems and extracted in the desired folder: + +1. Obtain, configure and build the desired version of *MRtrix3*: + + .. code-block:: console + + $ git checkout http://github.com/MRtrix3/mrtrix3.git + $ cd mrtrix3 + $ ./configure + $ ./build + +2. Collate the relevant folders and their contents into a single archive file: + + .. code-block:: console + + $ tar cvfz mrtrix3.tgz bin/ lib/ share/ + +3. Copy the resulting ``mrtrix3.tgz`` file over to the target system, into a + suitable location., for example (as root): + + .. code-block:: console + + # mkdir /usr/local/mrtrix3 + # cp mrtrix3.tgz /usr/local/mrtrix3/ + +4. Extract the archive in this location (as root): + + .. code-block:: console + + # cd /usr/local/mrtrix3/ + # tar xvfz mrtrix3.tgz + + Assuming no errors were generated, you can safely remove the ``mrtrix3.tgz`` + file at this point. + +5. Add the newly-extracted ``bin/`` folder to the ``PATH``, e.g.: + + .. code-block:: console + + $ export PATH=/usr/local/mrtrix3/bin:"$PATH" + + At which point *MRtrix3* command should be available to the corresponding + user. + + Note that the above command will only add *MRtrix3* to the ``PATH`` for the + current shell session. You would need to add the equivalent line to your + users' startup scripts, using whichever mechanism is appropriate for your + system. + diff --git a/docs/installation/linux_install.rst b/docs/installation/linux_install.rst index 887097e9c5..29abaebe71 100644 --- a/docs/installation/linux_install.rst +++ b/docs/installation/linux_install.rst @@ -263,30 +263,8 @@ Qt `__ beforehand. Use the ``-nogui`` option to skip installation of GUI components, which rely on Qt. -You can then copy the contents of the ``bin/``, ``lib/`` and ``share/`` folders -onto target systems, make sure the ``bin/`` folder location is listed in the -``PATH``, and start using these commands. For example: - -1. Create a single archive of the relevant folders (for easy deployment):: - - tar cvfz mrtrix3_static.tgz bin/ lib/ share/ - -2. Copy the resulting ``mrtrix3_static.tgz`` file over to the target system, - into a suitable location. - -3. Extract the archive in this location:: - - tar xvfz mrtrix3_static.tgz - - You can safely remove the ``mrtrix3_static.tgz`` file at this point. - -4. Add the ``bin/`` folder to the system ``PATH``, e.g.:: - - export PATH="$(pwd)/bin:$PATH" - - Note that the above command will only add *MRtrix3* to the ``PATH`` for the - current session. You would need to add the equivalent line to your users' - startup scripts, using whichever mechanism is appropriate for your system. +You can then deploy the software onto target systems, as described in the +:ref:`deployment` section. Standalone packager From 54329c33b5422e712efc1933beba409651969a88 Mon Sep 17 00:00:00 2001 From: Rami Tabbara Date: Fri, 25 Aug 2017 14:14:46 +1000 Subject: [PATCH 107/538] mrview: tract_geom: Adding support for pseudospheres * Render points with lighting --- .../mrview/tool/tractography/tractogram.cpp | 46 ++++++++++++------- .../mrview/tool/tractography/tractography.cpp | 6 +-- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/src/gui/mrview/tool/tractography/tractogram.cpp b/src/gui/mrview/tool/tractography/tractogram.cpp index 2101e831f5..c85bd10c43 100644 --- a/src/gui/mrview/tool/tractography/tractogram.cpp +++ b/src/gui/mrview/tool/tractography/tractogram.cpp @@ -230,11 +230,15 @@ namespace MR if (threshold_type != TrackThresholdType::None) source += using_geom ? "in float g_amp;\n" : "in vec3 v_amp;\n"; - if (use_lighting && using_geom) + if (use_lighting && (using_geom || using_points)) { source += "uniform float ambient, diffuse, specular, shine;\n" - "uniform vec3 light_pos;\n" - "in float g_height;\n"; + "uniform vec3 light_pos;\n"; + + if (using_geom) + source += "in float g_height;\n"; + } + if (do_crop_to_slab) source += using_geom ? "in float g_include;\n" : "in float v_include;\n"; @@ -243,7 +247,9 @@ namespace MR if (using_points) source += - "if(dot(gl_PointCoord-0.5,gl_PointCoord-0.5)>0.25)\n" + "vec2 pos = gl_PointCoord-0.5;\n" + "float d_pos = dot(pos, pos);\n" + "if(d_pos >0.25)\n" " discard;\n"; if (do_crop_to_slab) @@ -277,18 +283,25 @@ namespace MR source += " colour = const_colour;\n"; } - if (use_lighting && using_geom) - // g_height tells us where we are across the cylinder (0 - PI) - source += - // compute surface normal: - " float s = sin (g_height);\n" - " float c = cos (g_height);\n" - " vec3 tangent = normalize (mat3(MV) * g_tangent);\n" - " vec3 in_plane_x = normalize (vec3(-tangent.y, tangent.x, 0.0f));\n" - " vec3 in_plane_y = normalize (vec3(-tangent.x, -tangent.y, 0.0f));\n" - " vec3 surface_normal = c*in_plane_x + s*abs(tangent.z)*in_plane_y;\n" - " surface_normal.z -= s * sqrt(tangent.x*tangent.x + tangent.y*tangent.y);\n" - + if (use_lighting && (using_geom || using_points)) { + + if (using_geom) { + // g_height tells us where we are across the cylinder (0 - PI) + source += + // compute surface normal: + " float s = sin (g_height);\n" + " float c = cos (g_height);\n" + " vec3 tangent = normalize (mat3(MV) * g_tangent);\n" + " vec3 in_plane_x = normalize (vec3(-tangent.y, tangent.x, 0.0f));\n" + " vec3 in_plane_y = normalize (vec3(-tangent.x, -tangent.y, 0.0f));\n" + " vec3 surface_normal = c*in_plane_x + s*abs(tangent.z)*in_plane_y;\n" + " surface_normal.z -= s * sqrt(tangent.x*tangent.x + tangent.y*tangent.y);\n"; + } else if (using_points) { + source += + "vec3 surface_normal = normalize(vec3(pos, sin(d_pos - 0.25)));\n"; + } + + source += " float light_dot_surfaceN = -dot(light_pos, surface_normal);" // Ambient and diffuse component " colour *= ambient + diffuse * clamp(light_dot_surfaceN, 0, 1);\n" @@ -298,6 +311,7 @@ namespace MR " vec3 reflection = light_pos + 2 * light_dot_surfaceN * surface_normal;\n" " colour += specular * pow(clamp(-reflection.z, 0, 1), shine);\n" " }\n"; + } source += "}\n"; diff --git a/src/gui/mrview/tool/tractography/tractography.cpp b/src/gui/mrview/tool/tractography/tractography.cpp index e3965b24ba..514c7d7bd8 100644 --- a/src/gui/mrview/tool/tractography/tractography.cpp +++ b/src/gui/mrview/tool/tractography/tractography.cpp @@ -786,17 +786,13 @@ namespace MR const Tractogram* first_tractogram = tractogram_list_model->get_tractogram (indices[0]); TrackGeometryType geom_type = first_tractogram->get_geometry_type(); - if (geom_type == TrackGeometryType::Pseudotubes) { + if (geom_type == TrackGeometryType::Pseudotubes || geom_type == TrackGeometryType::Points) { thickness_slider->setHidden (false); thickness_label->setHidden (false); lighting_button->setEnabled (true); lighting_group_box->setEnabled (true); } - if (geom_type == TrackGeometryType::Points) { - thickness_slider->setHidden (false); - thickness_label->setHidden (false); - } } From 9f0bbae975e993f3f23cbbd92b9eae3c7fc0bf5c Mon Sep 17 00:00:00 2001 From: Rami Tabbara Date: Fri, 25 Aug 2017 14:59:53 +1000 Subject: [PATCH 108/538] mrview: tract_geom: Adding command-line option * Command-line option overrides any config option defaults --- .../mrview/tool/tractography/tractography.cpp | 60 ++++++++++++------- .../mrview/tool/tractography/tractography.h | 1 + 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/src/gui/mrview/tool/tractography/tractography.cpp b/src/gui/mrview/tool/tractography/tractography.cpp index 514c7d7bd8..31de47790c 100644 --- a/src/gui/mrview/tool/tractography/tractography.cpp +++ b/src/gui/mrview/tool/tractography/tractography.cpp @@ -35,6 +35,8 @@ namespace MR { namespace Tool { + const constexpr char* geom_types[] = { "Pseudotubes", "Lines", "Points", nullptr }; + TrackGeometryType index_to_geometry_type (const int idx) { TrackGeometryType geom_type = TrackGeometryType::Pseudotubes; @@ -274,31 +276,13 @@ namespace MR connect (action, SIGNAL(triggered()), this, SLOT (colour_by_scalar_file_slot())); track_option_menu->addAction (action); - static const constexpr char* geom_config_options[] = { "Pseudotubes", "Lines", "Points", nullptr }; - //CONF option: MRViewDefaultTractGeomType //CONF default: Pseudotubes //CONF The default geometry type used to render tractograms. //CONF Options are Pseudotubes, Lines or Points - const std::string default_geom_type = File::Config::get ("MRViewDefaultTractGeomType", geom_config_options[0]); - - if (default_geom_type != geom_config_options[0]) { - int index (0); - if (default_geom_type == geom_config_options[1]) - index = 1; - else if (default_geom_type == geom_config_options[2]) - index = 2; - - // In the instance where pseudotubes are not the default, enable lighting - if (index) { - Tractogram::default_tract_geom = index_to_geometry_type (index); - use_lighting = true; - lighting_group_box->setChecked (true); - geom_type_combobox->setCurrentIndex (index); - } - } + const std::string default_geom_type = File::Config::get ("MRViewDefaultTractGeomType", geom_types[0]); - update_geometry_type_gui(); + init_geometry_type (default_geom_type); } @@ -797,6 +781,28 @@ namespace MR + inline void Tractography::init_geometry_type(const std::string &type_str) { + if (type_str != geom_types[0]) { + int index (0); + if (type_str == geom_types[1]) + index = 1; + else if (type_str == geom_types[2]) + index = 2; + + // In the instance where pseudotubes are not the default, enable lighting + if (index) { + Tractogram::default_tract_geom = index_to_geometry_type (index); + use_lighting = true; + lighting_group_box->setChecked (true); + geom_type_combobox->setCurrentIndex (index); + } + } + + update_geometry_type_gui(); + } + + + void Tractography::add_commandline_options (MR::App::OptionList& options) { using namespace MR::App; @@ -809,6 +815,9 @@ namespace MR + Option ("tractography.thickness", "Line thickness of tractography display, [-1.0, 1.0], default is 0.0.").allow_multiple() + Argument("value").type_float ( -1.0, 1.0 ) + + Option ("tractography.geometry_type", "The default geometry type used when rendering tractograms, default is Pseudotubes") + + Argument("value").type_choice (geom_types) + + Option ("tractography.opacity", "Opacity of tractography display, [0.0, 1.0], default is 1.0.").allow_multiple() + Argument("value").type_float ( 0.0, 1.0 ) @@ -917,6 +926,17 @@ namespace MR return true; } + + if (opt.opt-> is ("tractography.geometry_type")) { + const std::string geom_type = opt[0]; + try { + init_geometry_type (geom_type); + } + catch (Exception& E) { E.display(); } + return true; + } + + if (opt.opt->is ("tractography.opacity")) { // Opacity runs from 0 to 1000, so multiply by 1000 float opacity = float(opt[0]) * 1000.0f; diff --git a/src/gui/mrview/tool/tractography/tractography.h b/src/gui/mrview/tool/tractography/tractography.h index be4b72c8fa..257c11dca9 100644 --- a/src/gui/mrview/tool/tractography/tractography.h +++ b/src/gui/mrview/tool/tractography/tractography.h @@ -120,6 +120,7 @@ namespace MR void select_last_added_tractogram(); bool process_commandline_option_tsf_check_tracto_loaded (); bool process_commandline_option_tsf_option (const MR::App::ParsedOption&, uint, vector& range); + void init_geometry_type(const std::string& type_str); void update_geometry_type_gui(); }; } From a351baff9d9bcc6d4abb8fc466a78adc257e62e3 Mon Sep 17 00:00:00 2001 From: Rami Tabbara Date: Fri, 25 Aug 2017 16:45:32 +1000 Subject: [PATCH 109/538] mrview: tract_geom: Support individual tractogram thickness --- .../mrview/tool/tractography/tractogram.cpp | 21 ++++++++++--------- src/gui/mrview/tool/tractography/tractogram.h | 4 +++- .../mrview/tool/tractography/tractography.cpp | 17 ++++++--------- .../mrview/tool/tractography/tractography.h | 2 -- 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/gui/mrview/tool/tractography/tractogram.cpp b/src/gui/mrview/tool/tractography/tractogram.cpp index c85bd10c43..5ad036df13 100644 --- a/src/gui/mrview/tool/tractography/tractogram.cpp +++ b/src/gui/mrview/tool/tractography/tractogram.cpp @@ -360,6 +360,7 @@ namespace MR Displayable (filename), show_colour_bar (true), original_fov (NAN), + line_thickness (0.f), intensity_scalar_filename (std::string()), threshold_scalar_filename (std::string()), tractography_tool (tool), @@ -453,15 +454,17 @@ namespace MR original_fov = std::pow (dim[0]*dim[1]*dim[2], 1.0f/3.0f); } - line_thickness_screenspace = - tractography_tool.line_thickness*original_fov*(transform.width()+transform.height()) / - ( 2.0*window().FOV()*transform.width()*transform.height()); + + float line_thickness_screenspace = + Tractogram::default_line_thickness * std::exp (2.0e-3f * line_thickness) * original_fov * + (transform.width()+transform.height()) / ( 2.f * window().FOV() * transform.width() * transform.height()); gl::Uniform1f (gl::GetUniformLocation (track_shader, "line_thickness"), line_thickness_screenspace); gl::Uniform1f (gl::GetUniformLocation (track_shader, "scale_x"), transform.width()); gl::Uniform1f (gl::GetUniformLocation (track_shader, "scale_y"), transform.height()); - float point_size_screenspace = tractography_tool.point_size*original_fov / window().FOV(); + float point_size_screenspace = (Tractogram::default_point_size * std::exp (2.0e-3f * line_thickness) + * original_fov) / window().FOV(); glPointSize(point_size_screenspace); @@ -562,13 +565,11 @@ namespace MR { const float step_size = DWI::Tractography::get_step_size (properties); GLint new_stride = 1; - if (std::isfinite (step_size)) { - new_stride = GLint (tractography_tool.line_thickness * original_fov / step_size); - new_stride = std::max (1, std::min (max_sample_stride, new_stride)); - } - if (geometry_type == TrackGeometryType::Pseudotubes) { - new_stride = GLint (tractography_tool.line_thickness * original_fov / step_size); + if (geometry_type != TrackGeometryType::Lines && std::isfinite (step_size)) { + const auto geom_size = geometry_type == TrackGeometryType::Pseudotubes ? + Tractogram::default_line_thickness : Tractogram::default_point_size; + new_stride = GLint (geom_size * std::exp (2.0e-3f * line_thickness) * original_fov / step_size); new_stride = std::max (1, std::min (max_sample_stride, new_stride)); } diff --git a/src/gui/mrview/tool/tractography/tractogram.h b/src/gui/mrview/tool/tractography/tractogram.h index d1eb838937..7557f947ee 100644 --- a/src/gui/mrview/tool/tractography/tractogram.h +++ b/src/gui/mrview/tool/tractography/tractogram.h @@ -84,12 +84,15 @@ namespace MR float get_threshold_max() const { return threshold_max; } static TrackGeometryType default_tract_geom; + static constexpr float default_line_thickness = 2e-3f; + static constexpr float default_point_size = 6.f; bool scalarfile_by_direction; bool show_colour_bar; bool should_update_stride; Eigen::Array3f colour; float original_fov; + float line_thickness; std::string intensity_scalar_filename; std::string threshold_scalar_filename; @@ -145,7 +148,6 @@ namespace MR vector > original_track_starts; vector num_tracks_per_buffer; GLint sample_stride; - float line_thickness_screenspace; bool vao_dirty; // Extra members now required since different scalar files diff --git a/src/gui/mrview/tool/tractography/tractography.cpp b/src/gui/mrview/tool/tractography/tractography.cpp index 31de47790c..0e377cde2f 100644 --- a/src/gui/mrview/tool/tractography/tractography.cpp +++ b/src/gui/mrview/tool/tractography/tractography.cpp @@ -22,10 +22,6 @@ #include "gui/opengl/lighting.h" #include "gui/lighting_dock.h" - // as a fraction of the image FOV: -#define MRTRIX_DEFAULT_LINE_THICKNESS 0.002f - -#define MRTRIX_DEFAULT_POINT_SIZE 5.f namespace MR { @@ -87,8 +83,6 @@ namespace MR Tractography::Tractography (Dock* parent) : Base (parent), - line_thickness (MRTRIX_DEFAULT_LINE_THICKNESS), - point_size (MRTRIX_DEFAULT_POINT_SIZE), do_crop_to_slab (true), use_lighting (false), not_3D (true), @@ -465,11 +459,10 @@ namespace MR void Tractography::line_thickness_slot (int thickness) { - line_thickness = MRTRIX_DEFAULT_LINE_THICKNESS * std::exp (2.0e-3f * thickness); - point_size = MRTRIX_DEFAULT_POINT_SIZE * std::exp (2.0e-3f * thickness); - - for (size_t i = 0, N = tractogram_list_model->rowCount(); i < N; ++i) { - Tractogram* tractogram = dynamic_cast(tractogram_list_model->items[i].get()); + QModelIndexList indices = tractogram_list_view->selectionModel()->selectedIndexes(); + for (int i = 0; i < indices.size(); ++i) { + Tractogram* tractogram = tractogram_list_model->get_tractogram (indices[i]); + tractogram->line_thickness = thickness; tractogram->should_update_stride = true; } @@ -737,6 +730,8 @@ namespace MR break; } geom_type_combobox->setCurrentIndex(geom_combobox_index); + + thickness_slider->setSliderPosition (first_tractogram->line_thickness); } diff --git a/src/gui/mrview/tool/tractography/tractography.h b/src/gui/mrview/tool/tractography/tractography.h index 257c11dca9..63c0193067 100644 --- a/src/gui/mrview/tool/tractography/tractography.h +++ b/src/gui/mrview/tool/tractography/tractography.h @@ -58,8 +58,6 @@ namespace MR virtual bool process_commandline_option (const MR::App::ParsedOption& opt) override; QPushButton* hide_all_button; - float line_thickness; - float point_size; bool do_crop_to_slab; bool use_lighting; bool use_threshold_scalarfile; From befca26e3f24812ca4440a80a1bba6a16104208e Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Fri, 25 Aug 2017 17:47:44 +1000 Subject: [PATCH 110/538] docs update --- docs/reference/commands/mrview.rst | 2 ++ docs/reference/config_file_options.rst | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/docs/reference/commands/mrview.rst b/docs/reference/commands/mrview.rst index 2e8681565c..ad90416275 100644 --- a/docs/reference/commands/mrview.rst +++ b/docs/reference/commands/mrview.rst @@ -124,6 +124,8 @@ Tractography tool options - **-tractography.thickness value** Line thickness of tractography display, [-1.0, 1.0], default is 0.0. +- **-tractography.geometry_type value** The default geometry type used when rendering tractograms, default is Pseudotubes + - **-tractography.opacity value** Opacity of tractography display, [0.0, 1.0], default is 1.0. - **-tractography.slab value** Slab thickness of tractography display, in mm. -1 to turn off crop to slab. diff --git a/docs/reference/config_file_options.rst b/docs/reference/config_file_options.rst index a0e170c8df..35078839f9 100644 --- a/docs/reference/config_file_options.rst +++ b/docs/reference/config_file_options.rst @@ -239,6 +239,11 @@ List of MRtrix3 configuration file options The width in pixels between horizontally adjacent colour bars. +* **MRViewDefaultTractGeomType** + *default: Pseudotubes* + + The default geometry type used to render tractograms. Options are Pseudotubes, Lines or Points + * **MRViewDockFloating** *default: 0 (false)* From 79209902bee0f60e79dcbd376b3fb5bf333bf93a Mon Sep 17 00:00:00 2001 From: Rami Tabbara Date: Mon, 28 Aug 2017 10:45:02 +1000 Subject: [PATCH 111/538] mrview: tract_geom: Fixing up surface normal calc for pseudosphere --- src/gui/mrview/tool/tractography/tractogram.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/mrview/tool/tractography/tractogram.cpp b/src/gui/mrview/tool/tractography/tractogram.cpp index 5ad036df13..725fd035e9 100644 --- a/src/gui/mrview/tool/tractography/tractogram.cpp +++ b/src/gui/mrview/tool/tractography/tractogram.cpp @@ -298,7 +298,7 @@ namespace MR " surface_normal.z -= s * sqrt(tangent.x*tangent.x + tangent.y*tangent.y);\n"; } else if (using_points) { source += - "vec3 surface_normal = normalize(vec3(pos, sin(d_pos - 0.25)));\n"; + "vec3 surface_normal = normalize(vec3(pos, sin((d_pos - 0.25) *" + str(Math::pi_2) + ")));\n"; } source += From 8e5dd9219906654fdc50c85d7c0d389a23acaed1 Mon Sep 17 00:00:00 2001 From: Rami Tabbara Date: Mon, 28 Aug 2017 11:13:29 +1000 Subject: [PATCH 112/538] mrview: tract_geom: Consistent sizing algo for points and lines --- src/gui/mrview/tool/tractography/tractogram.cpp | 5 +++-- src/gui/mrview/tool/tractography/tractogram.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/mrview/tool/tractography/tractogram.cpp b/src/gui/mrview/tool/tractography/tractogram.cpp index 725fd035e9..9507c56cf2 100644 --- a/src/gui/mrview/tool/tractography/tractogram.cpp +++ b/src/gui/mrview/tool/tractography/tractogram.cpp @@ -463,8 +463,9 @@ namespace MR gl::Uniform1f (gl::GetUniformLocation (track_shader, "scale_x"), transform.width()); gl::Uniform1f (gl::GetUniformLocation (track_shader, "scale_y"), transform.height()); - float point_size_screenspace = (Tractogram::default_point_size * std::exp (2.0e-3f * line_thickness) - * original_fov) / window().FOV(); + float point_size_screenspace = + Tractogram::default_point_size * std::exp (2.0e-3f * line_thickness) * original_fov * + (transform.width()+transform.height()) / ( 2.f * window().FOV()); glPointSize(point_size_screenspace); diff --git a/src/gui/mrview/tool/tractography/tractogram.h b/src/gui/mrview/tool/tractography/tractogram.h index 7557f947ee..6644915e1a 100644 --- a/src/gui/mrview/tool/tractography/tractogram.h +++ b/src/gui/mrview/tool/tractography/tractogram.h @@ -85,7 +85,7 @@ namespace MR static TrackGeometryType default_tract_geom; static constexpr float default_line_thickness = 2e-3f; - static constexpr float default_point_size = 6.f; + static constexpr float default_point_size = 4e-3f; bool scalarfile_by_direction; bool show_colour_bar; From 23086ca3b258a9c4ed852fd2a98fa5ffb24ab198 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Tue, 29 Aug 2017 13:55:45 +1000 Subject: [PATCH 113/538] initial updates to response function estimation docs. More to follow, this is a work in progress at this stage. Just committing now to check the readthedocs output for layout. --- .../response_function_estimation.rst | 109 ++++++++---------- .../getting_started/beginner_dwi_tutorial.rst | 2 +- 2 files changed, 50 insertions(+), 61 deletions(-) diff --git a/docs/constrained_spherical_deconvolution/response_function_estimation.rst b/docs/constrained_spherical_deconvolution/response_function_estimation.rst index 5a1d5b1e4d..86e1f79fb6 100644 --- a/docs/constrained_spherical_deconvolution/response_function_estimation.rst +++ b/docs/constrained_spherical_deconvolution/response_function_estimation.rst @@ -1,47 +1,47 @@ -.. _response_fn_estimation: +.. _response_function_estimation: Response function estimation ============================ -A compulsory step in spherical deconvolution is deriving the 'response -function (RF)', which is used as the kernel during the deconvolution -step. For the white matter, this is the signal expected for a voxel -containing a single, coherently-oriented fibre bundle. While some groups -prefer to define this function using some *ad-hoc* template function -(e.g. a diffusion tensor with empirical diffusivities), the MRtrix -contributors are in preference of deriving this function directly from -the image data, typically by averaging the diffusion signal from a set -of empirically-determined 'single-fibre (SF)' voxels. - -The process of estimating this function from the data is however -non-trivial; there is no single unambiguous way in which this should be -done. Earlier in the beta version of MRtrix3, we provided a command -``dwi2response`` that advertised automated determination of the response -function, based on a `published -method `__ -with a few additional enhancements. Unfortunately user testing showed -that this algorithm would not produce the desired result in a number of -circumstances, and the available command-line options for altering its -behaviour were not intuitive. - -As a result, we are now instead providing :ref:`dwi2response` as a -*script*. This was done for a few reasons. Firstly, it means that we can -provide multiple different mechanisms / algorithms for response function -estimation, all accessible within the one script, allowing users to -experiment with different approaches. Secondly, because these Python -scripts are more accessible to most users than C++ code, the algorithms -themselves can be modified, or some may even choose to try devising -their own heiristics for response function estimation. Thirdly, it -reinforces the fact that there is unfortunately *not* a black-box, -one-size-fits-all solution to this problem. - -Here I will discuss some of the technical aspects of response function -estimation, and describe the mechanisms by which the currently provided -algorithms work. If however you are not interested in the nitty-gritty -of this process, feel free to scroll to the bottom of the page. - -Necessary steps ---------------- +A prerequisite for spherical deconvolution is obtaining response +function(s), which is/are used as the kernel(s) by the deconvolution +algorithm. For the white matter, the response function is the signal +expected for a voxel containing a single, coherently oriented bundle +of axons. In case of multi-tissue variants of spherical deconvolution, +response functions for other tissue types may be introduced as well; +the most common ones being grey matter and/or CSF. + +In MRtrix3, the :ref:`dwi2response` script offers a range of algorithms +to estimate these response function(s) directly from your dataset itself. +This process of estimating response function(s) from the data is +non-trivial. No single algorithm works for *any* possible scenario, +although some have proven to be more widely applicable than others. + +Quick advice +------------ + +These options appear to perform well in a wide range of scenarios, +based on experience and testing from both developers and the +`MRtrix3 community `__.: + +- If you intend to perform *single-tissue* spherical deconvolution, + the ``tournier`` algorithm is a convenient and reliable way to + estimate the single-fibre white matter response function:: + + dwi2response tournier dwi.mif wm_response.txt + +- If you intend to perform *multi-tissue* spherical deconvolution, + the ``dhollander`` algorithm is a convenient and reliable way to + estimate the single-fibre white matter response function as well + as the grey matter and CSF response functions:: + + dwi2response dhollander dwi.mif wm_response.txt gm_response.txt csf_response.txt + + + + +More information +---------------- Looking at the process of response function estimation in full detail, there are four crucial steps. For each of these, I will also briefly @@ -76,6 +76,11 @@ this process may also change with ongoing development. ``dwi2response`` algorithms --------------------------- +``dhollander`` +^^^^^^^^^^^^^^ + +TODO: Thijs is working on this documentation page. + ``fa`` ^^^^^^ @@ -296,24 +301,8 @@ processing of non-human brain images in particular, you may need to experiment with the number of single-fibre voxels as the white matter is typically smaller. -TL;DR ------ - -If this document appears far too long for your liking, or you're not -particularly interested in the details and just want to know what option -to use so that you can continue with your processing, the following are -our 'cautious' recommendations. However we emphasize that this script -may not work flawlessly for all data; if it did, we wouldn't be -providing a script with so many options! Furthermore, these -recommendations may change over time, so check in every now and then, -and make sure to sign up to the new `community -forum `__. - -- If you're processing single-shell data, the ``tournier`` algorithm - appears to be fairly robust. - -- If you're processing multi-shell data, and are able to perform EPI - inhomogeneity distortion correction, ``msmt_5tt`` is currently the - only fully-automated method for getting multi-shell multi-tissue - response functions. +Writing your own algorithms +--------------------------- + +TODO: Thijs is working on this documentation page. diff --git a/docs/getting_started/beginner_dwi_tutorial.rst b/docs/getting_started/beginner_dwi_tutorial.rst index 4e9fc4f16f..06d09a67d6 100644 --- a/docs/getting_started/beginner_dwi_tutorial.rst +++ b/docs/getting_started/beginner_dwi_tutorial.rst @@ -48,7 +48,7 @@ Response function estimation To perform spherical deconvolution, the DWI signal emanating from a single coherently-oriented fibre bundle must be estimated. We provide a script for doing this, which has :ref:`a range of algorithms and -parameters `. This example will use +parameters `. This example will use fairly sensible defaults: .. code:: From 0af3c6f2b2656a1c6d4b334fb09c1e126880e364 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Tue, 29 Aug 2017 14:19:46 +1000 Subject: [PATCH 114/538] intermediary layout testing and fixing --- .../response_function_estimation.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/constrained_spherical_deconvolution/response_function_estimation.rst b/docs/constrained_spherical_deconvolution/response_function_estimation.rst index 86e1f79fb6..8817a862fa 100644 --- a/docs/constrained_spherical_deconvolution/response_function_estimation.rst +++ b/docs/constrained_spherical_deconvolution/response_function_estimation.rst @@ -22,20 +22,22 @@ Quick advice These options appear to perform well in a wide range of scenarios, based on experience and testing from both developers and the -`MRtrix3 community `__.: +`MRtrix3 community `__.: - If you intend to perform *single-tissue* spherical deconvolution, the ``tournier`` algorithm is a convenient and reliable way to - estimate the single-fibre white matter response function:: + estimate the single-fibre white matter response function: + :: - dwi2response tournier dwi.mif wm_response.txt + dwi2response tournier dwi.mif wm_response.txt - If you intend to perform *multi-tissue* spherical deconvolution, the ``dhollander`` algorithm is a convenient and reliable way to estimate the single-fibre white matter response function as well - as the grey matter and CSF response functions:: + as the grey matter and CSF response functions: + :: - dwi2response dhollander dwi.mif wm_response.txt gm_response.txt csf_response.txt + dwi2response dhollander dwi.mif wm_response.txt gm_response.txt csf_response.txt From 9d170be6df04a50361e14e564cbd642a39fb690c Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 29 Aug 2017 14:35:43 +1000 Subject: [PATCH 115/538] Changes to enforce requested thread counts At the track mapping stage of tcksift / tcksift2, multiple threads were being invoked for both the streamline-voxel mapping and the streamline-fixel visitation encoding, resulting in twice as many threads being spawned as what was requested. These two tasks are now combined into a single functor such that the requested number of threads is honoured. In tckgen -seed_dynamic, multi-threading both the tracking and streamline-voxel mapping functors could result in the use of more resources than had been requested. In these changes, the back-end keeps track of whether the number of threads was explicitly requested by the user, or whether it was set automatically based on the detected hardware concurrency: If an explicit request was made, then each of these stages will run with half of the requested number of threads, such that the total requested resources are not (substantially) exceeded; whereas if no explicit request is made, then the maximum number of threads will be spawned for both stages, with the system then being responsible for managing the load between the different threads. Relates to discussion in #1105. --- core/thread.cpp | 29 +++++++++--- core/thread.h | 56 +++++++++++++---------- src/dwi/tractography/SIFT/model.h | 67 ++++++++++++++-------------- src/dwi/tractography/tracking/exec.h | 20 ++++++--- 4 files changed, 106 insertions(+), 66 deletions(-) diff --git a/core/thread.cpp b/core/thread.cpp index ad028dd421..1be80a5518 100644 --- a/core/thread.cpp +++ b/core/thread.cpp @@ -28,6 +28,7 @@ namespace MR namespace { size_t __number_of_threads = 0; + nthreads_t __nthreads_type = nthreads_t::UNINITIALISED; } @@ -37,25 +38,43 @@ namespace MR size_t number_of_threads () { - if (__number_of_threads) + if (__nthreads_type != nthreads_t::UNINITIALISED) return __number_of_threads; + auto opt = App::get_options ("nthreads"); if (opt.size()) { __number_of_threads = opt[0][0]; + __nthreads_type = nthreads_t::EXPLICIT; return __number_of_threads; } const char* from_env = getenv ("MRTRIX_NTHREADS"); if (from_env) { __number_of_threads = to (from_env); + __nthreads_type = nthreads_t::EXPLICIT; return __number_of_threads; } - __number_of_threads = File::Config::get_int ("NumberOfThreads", std::thread::hardware_concurrency()); + if (File::Config::get ("NumberOfThreads").size()) { + const int i = File::Config::get_int ("NumberOfThreads", -1); + if (i >= 0) { + __number_of_threads = i; + __nthreads_type = nthreads_t::EXPLICIT; + return __number_of_threads; + } + } + __number_of_threads = std::thread::hardware_concurrency(); + __nthreads_type = nthreads_t::IMPLICIT; return __number_of_threads; } + nthreads_t type_nthreads() + { + return __nthreads_type; + } + + @@ -67,10 +86,10 @@ namespace MR DEBUG ("initialising threads..."); std::atomic a; - if (!a.is_lock_free()) + if (!a.is_lock_free()) WARN ("atomic operations on uint8_t are not lock-free - this may introduce instabilities in operation!"); - if (sizeof (a) != sizeof (uint8_t)) + if (sizeof (a) != sizeof (uint8_t)) WARN ("size of atomic differs from that of uint8_t - this may introduce instabilities in operation!"); previous_print_func = print; @@ -80,7 +99,7 @@ namespace MR report_to_user_func = thread_report_to_user_func; } - __Backend::~__Backend () + __Backend::~__Backend () { print = previous_print_func; report_to_user_func = previous_report_to_user_func; diff --git a/core/thread.h b/core/thread.h index 4b0ad532bc..3e7faadac4 100644 --- a/core/thread.h +++ b/core/thread.h @@ -29,8 +29,8 @@ * These functions and associated classes provide a simple interface for * multi-threading in MRtrix applications. Most of the low-level funtionality * relies on the C++11 `std::thread` API. MRtrix3 builds on this to add three - * convenience methods: - * + * convenience methods: + * * - [Thread::run()](@ref Thread::run()) to launch one or more worker threads; * * - [ThreadedLoop()](@ref image_thread_looping) to run an operation over all voxels @@ -61,11 +61,11 @@ namespace MR __Backend(); ~__Backend(); - static void register_thread () { + static void register_thread () { std::lock_guard lock (mutex); if (!backend) backend = new __Backend; - ++backend->refcount; + ++backend->refcount; } static void unregister_thread () { assert (backend); @@ -109,7 +109,7 @@ namespace MR public: template __single_thread (Functor&& functor, const std::string& name = "unnamed") : - __thread_base (name) { + __thread_base (name) { DEBUG ("launching thread \"" + name + "\"..."); using F = typename std::remove_reference::type; thread = std::async (std::launch::async, &F::execute, &functor); @@ -119,7 +119,7 @@ namespace MR void wait () noexcept (false) { DEBUG ("waiting for completion of thread \"" + name + "\"..."); - thread.get(); + thread.get(); DEBUG ("thread \"" + name + "\" completed OK"); } @@ -139,11 +139,11 @@ namespace MR class __multi_thread : public __thread_base { NOMEMALIGN public: __multi_thread (Functor& functor, size_t nthreads, const std::string& name = "unnamed") : - __thread_base (name), functors ( (nthreads>0 ? nthreads-1 : 0), functor) { + __thread_base (name), functors ( (nthreads>0 ? nthreads-1 : 0), functor) { DEBUG ("launching " + str (nthreads) + " threads \"" + name + "\"..."); using F = typename std::remove_reference::type; threads.reserve (nthreads); - for (auto& f : functors) + for (auto& f : functors) threads.push_back (std::async (std::launch::async, &F::execute, &f)); threads.push_back (std::async (std::launch::async, &F::execute, &functor)); } @@ -155,22 +155,22 @@ namespace MR DEBUG ("waiting for completion of threads \"" + name + "\"..."); bool exception_thrown = false; for (auto& t : threads) { - if (!t.valid()) + if (!t.valid()) continue; try { t.get(); } - catch (Exception& E) { + catch (Exception& E) { exception_thrown = true; - E.display(); + E.display(); } } - if (exception_thrown) + if (exception_thrown) throw Exception ("exception thrown from one or more threads \"" + name + "\""); DEBUG ("threads \"" + name + "\" completed OK"); } bool any_valid () const { - for (auto& t : threads) - if (t.valid()) + for (auto& t : threads) + if (t.valid()) return true; return false; } @@ -188,7 +188,7 @@ namespace MR }; - template + template class __Multi { NOMEMALIGN public: __Multi (Functor& object, size_t number) : functor (object), num (number) { } @@ -233,7 +233,7 @@ namespace MR * multi-threaded applications, in practice the \ref image_thread_looping * and \ref thread_queue APIs provide much more convenient and powerful * ways of developing robust and efficient applications. - * + * * @{ */ /*! the number of cores to use for multi-threading, as specified in the @@ -241,18 +241,28 @@ namespace MR * the -nthreads command-line option */ size_t number_of_threads (); + /*! provides information regarding whether the number of threads has been + * initialised, set explicitly, or determined implicitly. This may affect + * how particular algorithms choose to launch threads depending on the + * presence of a user request. It also prevents repeated testing of + * config file / environment variables, since 0 was previously used both + * as an indication of being uninitialised as well as being a valid value + * (indicates purely single-threaded operation). */ + enum class nthreads_t { UNINITIALISED, EXPLICIT, IMPLICIT }; + nthreads_t type_nthreads (); + //! used to request multiple threads of the corresponding functor /*! This function is used in combination with Thread::run or * Thread::run_queue to request that the functor \a object be run in * parallel using \a number threads of execution (defaults to - * Thread::number_of_threads()). - * \sa Thread::run() + * Thread::number_of_threads()). + * \sa Thread::run() * \sa Thread::run_queue() */ template - inline __Multi::type> - multi (Functor&& functor, size_t nthreads = number_of_threads()) + inline __Multi::type> + multi (Functor&& functor, size_t nthreads = number_of_threads()) { return { functor, nthreads }; } @@ -309,7 +319,7 @@ namespace MR * threads from throwing exceptions. This means you should perform all * error checking within a single-threaded context, before starting * processing-intensive threads, so as to minimise the chances of anything - * going wrong at that stage. + * going wrong at that stage. * * In this implementation, the wait() function can be used to wait until * all threads have completed, at which point any exceptions thrown will be @@ -330,12 +340,12 @@ namespace MR * within the same scope, each of which might throw. In these cases, it is * best to explicitly call wait() for each of the objects returned by * Thread::run(), rather than relying on the destructor alone (note - * Thread::Queue already does this). + * Thread::Queue already does this). * * \sa Thread::multi() */ template - inline typename __run::type run (Functor&& functor, const std::string& name = "unnamed") + inline typename __run::type run (Functor&& functor, const std::string& name = "unnamed") { return __run::type>() (functor, name); } diff --git a/src/dwi/tractography/SIFT/model.h b/src/dwi/tractography/SIFT/model.h index 7aff2e6e61..79dd7c8433 100644 --- a/src/dwi/tractography/SIFT/model.h +++ b/src/dwi/tractography/SIFT/model.h @@ -103,23 +103,30 @@ namespace MR private: // Some member classes to support multi-threaded processes - class MappedTrackReceiver - { MEMALIGN(MappedTrackReceiver) + class TrackMappingWorker + { MEMALIGN(TrackMappingWorker) public: - MappedTrackReceiver (Model& i) : - master (i), - mutex (new std::mutex), - TD_sum (0.0), - fixel_TDs (master.fixels.size(), 0.0) { } - MappedTrackReceiver (const MappedTrackReceiver& that) : - master (that.master), - mutex (that.mutex), - TD_sum (0.0), - fixel_TDs (master.fixels.size(), 0.0) { } - ~MappedTrackReceiver(); - bool operator() (const Mapping::SetDixel&); + TrackMappingWorker (Model& i, const default_type upsample_ratio) : + master (i), + mapper (i.header(), i.dirs), + mutex (new std::mutex), + TD_sum (0.0), + fixel_TDs (master.fixels.size(), 0.0) + { + mapper.set_upsample_ratio (upsample_ratio); + mapper.set_use_precise_mapping (true); + } + TrackMappingWorker (const TrackMappingWorker& that) : + master (that.master), + mapper (that.mapper), + mutex (that.mutex), + TD_sum (0.0), + fixel_TDs (master.fixels.size(), 0.0) { } + ~TrackMappingWorker(); + bool operator() (const Tractography::Streamline<>&); private: Model& master; + Mapping::TrackMapperBase mapper; std::shared_ptr mutex; double TD_sum; vector fixel_TDs; @@ -171,16 +178,10 @@ namespace MR { Mapping::TrackLoader loader (file, count); - Mapping::TrackMapperBase mapper (Fixel_map::header(), dirs); - mapper.set_upsample_ratio (Mapping::determine_upsample_ratio (Fixel_map::header(), properties, 0.1)); - mapper.set_use_precise_mapping (true); - MappedTrackReceiver receiver (*this); - Thread::run_queue ( - loader, - Thread::batch (Tractography::Streamline<>()), - Thread::multi (mapper), - Thread::batch (Mapping::SetDixel()), - Thread::multi (receiver)); + TrackMappingWorker worker (*this, Mapping::determine_upsample_ratio (Fixel_map::header(), properties, 0.1)); + Thread::run_queue (loader, + Thread::batch (Tractography::Streamline<>()), + Thread::multi (worker)); } if (!contributions.back()) { @@ -317,7 +318,7 @@ namespace MR template - Model::MappedTrackReceiver::~MappedTrackReceiver() + Model::TrackMappingWorker::~TrackMappingWorker() { std::lock_guard lock (*mutex); master.TD_sum += TD_sum; @@ -328,20 +329,20 @@ namespace MR template - bool Model::MappedTrackReceiver::operator() (const Mapping::SetDixel& in) + bool Model::TrackMappingWorker::operator() (const Tractography::Streamline<>& in) { - - if (in.index >= master.contributions.size()) - throw Exception ("Received mapped streamline beyond the expected number of streamlines (run tckfixcount on your .tck file!)"); - if (master.contributions[in.index]) - throw Exception ("FIXME: Same streamline has been mapped multiple times! (?)"); + assert (in.index < master.contributions.size()); + assert (!master.contributions[in.index]); try { + Mapping::SetDixel dixels; + mapper (in, dixels); + vector masked_contributions; - double total_contribution = 0.0, total_length = 0.0; + default_type total_contribution = 0.0, total_length = 0.0; - for (Mapping::SetDixel::const_iterator i = in.begin(); i != in.end(); ++i) { + for (Mapping::SetDixel::const_iterator i = dixels.begin(); i != dixels.end(); ++i) { total_length += i->get_length(); const size_t fixel_index = master.dixel2fixel (*i); if (fixel_index && (i->get_length() > Track_fixel_contribution::min())) { diff --git a/src/dwi/tractography/tracking/exec.h b/src/dwi/tractography/tracking/exec.h index 6e50e03154..42896fa667 100644 --- a/src/dwi/tractography/tracking/exec.h +++ b/src/dwi/tractography/tracking/exec.h @@ -16,6 +16,7 @@ #define __dwi_tractography_tracking_exec_h__ +#include "thread.h" #include "thread_queue.h" #include "dwi/directions/set.h" #include "dwi/tractography/streamline.h" @@ -91,12 +92,21 @@ namespace MR mapper.set_upsample_ratio (Mapping::determine_upsample_ratio (fod_data, properties, 0.25)); mapper.set_use_precise_mapping (true); + // If the user has explicitly requested no more than a set number of threads, + // then split that number of threads between the tracking and mapping steps. + // If however the number of threads has been implicitly calculated based on + // hardware concurrency, then spawn that number of threads for both stages, + // and let the system deal with balancing the load. + const size_t nthreads = MR::Thread::type_nthreads() == MR::Thread::nthreads_t::EXPLICIT ? + MR::Thread::number_of_threads()/2 : + MR::Thread::number_of_threads(); + Thread::run_queue ( - Thread::multi (tracker), + Thread::multi (tracker, nthreads), Thread::batch (GeneratedTrack(), TRACKING_BATCH_SIZE), - writer, + writer, Thread::batch (Streamline<>(), TRACKING_BATCH_SIZE), - Thread::multi (mapper), + Thread::multi (mapper, nthreads), Thread::batch (SetDixel(), TRACKING_BATCH_SIZE), *seeder); @@ -403,7 +413,7 @@ namespace MR } if (S.act().backtrack()) { - for (const auto& i : tck) + for (const auto& i : tck) S.properties.include.contains (i, track_included); } @@ -443,7 +453,7 @@ namespace MR if (!ACT_WM_INT_REQ && !ACT_WM_ABS_REQ) return true; float integral = 0.0, max_value = 0.0; - for (const auto& i : tck) { + for (const auto& i : tck) { if (method.act().fetch_tissue_data (i)) { const float wm = method.act().tissues().get_wm(); max_value = std::max (max_value, wm); From 58da8e004e9f2efa65f30eee83f11432b459cec4 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Tue, 29 Aug 2017 16:21:55 +1000 Subject: [PATCH 116/538] ongoing edits --- .../response_function_estimation.rst | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/constrained_spherical_deconvolution/response_function_estimation.rst b/docs/constrained_spherical_deconvolution/response_function_estimation.rst index 8817a862fa..644ecb3a5b 100644 --- a/docs/constrained_spherical_deconvolution/response_function_estimation.rst +++ b/docs/constrained_spherical_deconvolution/response_function_estimation.rst @@ -20,7 +20,7 @@ although some have proven to be more widely applicable than others. Quick advice ------------ -These options appear to perform well in a wide range of scenarios, +These algorithms appear to perform well in a wide range of scenarios, based on experience and testing from both developers and the `MRtrix3 community `__.: @@ -39,7 +39,27 @@ based on experience and testing from both developers and the dwi2response dhollander dwi.mif wm_response.txt gm_response.txt csf_response.txt +In general, it's always worthwhile checking your response function(s): + :: + + shview wm_response.txt + +Use the left and right arrow (keyboard) keys in this viewer to switch +between the different b-values ('shells') of the response function, if +it has more than one (this would for example be the case for the outputs +of the ``dhollander`` algorithm). + +It may also be helpful to check which voxels were selected by the +algorithm to estimate the response function(s) from. For any :ref:`dwi2response` +algorithm, this can be done by adding the ``-voxels`` option, which +stores an image of these voxels for further inspection. For example, +for the ``tournier`` algorithm: + :: + dwi2response tournier dwi.mif wm_response.txt -voxels voxels.mif + +The resulting ``voxels.mif`` image can be overlaid on the ``dwi.mif`` +dataset using the :ref:`mrview` viewer. More information From eb07e1fe107e14a27dca81b20efb8eba0d8fdc36 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Tue, 29 Aug 2017 16:31:21 +1000 Subject: [PATCH 117/538] ongoing layout --- .../response_function_estimation.rst | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/docs/constrained_spherical_deconvolution/response_function_estimation.rst b/docs/constrained_spherical_deconvolution/response_function_estimation.rst index 644ecb3a5b..4ee816f2ba 100644 --- a/docs/constrained_spherical_deconvolution/response_function_estimation.rst +++ b/docs/constrained_spherical_deconvolution/response_function_estimation.rst @@ -27,6 +27,7 @@ based on experience and testing from both developers and the - If you intend to perform *single-tissue* spherical deconvolution, the ``tournier`` algorithm is a convenient and reliable way to estimate the single-fibre white matter response function: + :: dwi2response tournier dwi.mif wm_response.txt @@ -35,14 +36,16 @@ based on experience and testing from both developers and the the ``dhollander`` algorithm is a convenient and reliable way to estimate the single-fibre white matter response function as well as the grey matter and CSF response functions: + :: dwi2response dhollander dwi.mif wm_response.txt gm_response.txt csf_response.txt In general, it's always worthwhile checking your response function(s): - :: - shview wm_response.txt +:: + + shview wm_response.txt Use the left and right arrow (keyboard) keys in this viewer to switch between the different b-values ('shells') of the response function, if @@ -50,16 +53,17 @@ it has more than one (this would for example be the case for the outputs of the ``dhollander`` algorithm). It may also be helpful to check which voxels were selected by the -algorithm to estimate the response function(s) from. For any :ref:`dwi2response` -algorithm, this can be done by adding the ``-voxels`` option, which -stores an image of these voxels for further inspection. For example, -for the ``tournier`` algorithm: - :: +algorithm to estimate the response function(s) from. For any +:ref:`dwi2response` algorithm, this can be done by adding the ``-voxels`` +option, which outputs an image of these voxels. For example, for +the ``tournier`` algorithm: + +:: - dwi2response tournier dwi.mif wm_response.txt -voxels voxels.mif + dwi2response tournier dwi.mif wm_response.txt -voxels voxels.mif The resulting ``voxels.mif`` image can be overlaid on the ``dwi.mif`` -dataset using the :ref:`mrview` viewer. +dataset using the :ref:`mrview` image viewer for further inspection. More information From e478cec88de283225a924ca7dfa01b36b8672c6c Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 29 Aug 2017 17:54:14 +1000 Subject: [PATCH 118/538] mrview: -tractography.geometry tweaks - Renamed -tractography.geometry_type to just -tractography.geometry. - Fixed operation of command-line option; code was mixed up with that used to set up the initial 'default' geometry type. - Behaviour depends on positioning of commandline option: If it appears before any track files are loaded, this sets the default geometry to be used for all subsequent -tractography.load calls; if at least one file has been opened, it applies to the previous file loaded on the command-line (so that different track files can be immediately set up with different geometries). - Better handling of potential malformed option strings, both when using this command-line option and for the config file entry. - Provide list of valid parameters for -tractography.geometry option, rather than just indicating the default. --- docs/reference/commands/mrview.rst | 2 +- .../mrview/tool/tractography/tractography.cpp | 121 ++++++++++-------- .../mrview/tool/tractography/tractography.h | 5 +- 3 files changed, 69 insertions(+), 59 deletions(-) diff --git a/docs/reference/commands/mrview.rst b/docs/reference/commands/mrview.rst index ad90416275..f36a65ab39 100644 --- a/docs/reference/commands/mrview.rst +++ b/docs/reference/commands/mrview.rst @@ -124,7 +124,7 @@ Tractography tool options - **-tractography.thickness value** Line thickness of tractography display, [-1.0, 1.0], default is 0.0. -- **-tractography.geometry_type value** The default geometry type used when rendering tractograms, default is Pseudotubes +- **-tractography.geometry value** The geometry type to use when rendering tractograms (options are: pseudotubes, lines, points) - **-tractography.opacity value** Opacity of tractography display, [0.0, 1.0], default is 1.0. diff --git a/src/gui/mrview/tool/tractography/tractography.cpp b/src/gui/mrview/tool/tractography/tractography.cpp index 0e377cde2f..d64c7cc775 100644 --- a/src/gui/mrview/tool/tractography/tractography.cpp +++ b/src/gui/mrview/tool/tractography/tractography.cpp @@ -31,22 +31,28 @@ namespace MR { namespace Tool { - const constexpr char* geom_types[] = { "Pseudotubes", "Lines", "Points", nullptr }; - - TrackGeometryType index_to_geometry_type (const int idx) { - TrackGeometryType geom_type = TrackGeometryType::Pseudotubes; + const char* tractogram_geometry_types[] = { "pseudotubes", "lines", "points", nullptr }; + TrackGeometryType geometry_index2type (const int idx) + { switch (idx) { - case 1: - geom_type = TrackGeometryType::Lines; - break; - case 2: - geom_type = TrackGeometryType::Points; - default: - break; + case 0: return TrackGeometryType::Pseudotubes; + case 1: return TrackGeometryType::Lines; + case 2: return TrackGeometryType::Points; + default: assert (0); return TrackGeometryType::Pseudotubes; } + } - return geom_type; + size_t geometry_string2index (std::string type_str) + { + type_str = lowercase (type_str); + size_t index = 0; + for (const char* const* p = tractogram_geometry_types; *p; ++p, ++index) { + if (type_str == *p) + return index; + } + throw Exception ("Unrecognised value for tractogram geometry \"" + type_str + "\" (options are: " + join(tractogram_geometry_types, ", ") + "); ignoring"); + return 0; } @@ -274,9 +280,22 @@ namespace MR //CONF default: Pseudotubes //CONF The default geometry type used to render tractograms. //CONF Options are Pseudotubes, Lines or Points - const std::string default_geom_type = File::Config::get ("MRViewDefaultTractGeomType", geom_types[0]); + const std::string default_geom_type = File::Config::get ("MRViewDefaultTractGeomType", tractogram_geometry_types[0]); + try { + const size_t default_geom_index = geometry_string2index (default_geom_type); + Tractogram::default_tract_geom = geometry_index2type (default_geom_index); + geom_type_combobox->setCurrentIndex (default_geom_index); + } catch (Exception& e) { + e.display(); + } - init_geometry_type (default_geom_type); + // In the instance where pseudotubes are _not_ the default, enable lighting by default + if (Tractogram::default_tract_geom != TrackGeometryType::Pseudotubes) { + use_lighting = true; + lighting_group_box->setChecked (true); + } + + update_geometry_type_gui(); } @@ -332,7 +351,7 @@ namespace MR vector list = Dialog::File::get_files (this, "Select tractograms to open", "Tractograms (*.tck)"); add_tractogram(list); } - + @@ -348,7 +367,7 @@ namespace MR catch (Exception& E) { E.display(); } - + } @@ -650,9 +669,9 @@ namespace MR - void Tractography::geom_type_selection_slot(int selected_index) + void Tractography::geom_type_selection_slot (int selected_index) { - TrackGeometryType geom_type = index_to_geometry_type (selected_index); + TrackGeometryType geom_type = geometry_index2type (selected_index); QModelIndexList indices = tractogram_list_view->selectionModel()->selectedIndexes(); for (int i = 0; i < indices.size(); ++i) @@ -720,6 +739,8 @@ namespace MR TrackGeometryType geom_type = first_tractogram->get_geometry_type(); int geom_combobox_index = 0; switch (geom_type) { + case TrackGeometryType::Pseudotubes: + break; case TrackGeometryType::Lines: geom_combobox_index = 1; break; @@ -727,6 +748,7 @@ namespace MR geom_combobox_index = 2; break; default: + assert (0); break; } geom_type_combobox->setCurrentIndex(geom_combobox_index); @@ -763,7 +785,7 @@ namespace MR geom_type_combobox->setEnabled (true); const Tractogram* first_tractogram = tractogram_list_model->get_tractogram (indices[0]); - TrackGeometryType geom_type = first_tractogram->get_geometry_type(); + const TrackGeometryType geom_type = first_tractogram->get_geometry_type(); if (geom_type == TrackGeometryType::Pseudotubes || geom_type == TrackGeometryType::Points) { thickness_slider->setHidden (false); @@ -776,25 +798,7 @@ namespace MR - inline void Tractography::init_geometry_type(const std::string &type_str) { - if (type_str != geom_types[0]) { - int index (0); - if (type_str == geom_types[1]) - index = 1; - else if (type_str == geom_types[2]) - index = 2; - - // In the instance where pseudotubes are not the default, enable lighting - if (index) { - Tractogram::default_tract_geom = index_to_geometry_type (index); - use_lighting = true; - lighting_group_box->setChecked (true); - geom_type_combobox->setCurrentIndex (index); - } - } - update_geometry_type_gui(); - } @@ -810,8 +814,8 @@ namespace MR + Option ("tractography.thickness", "Line thickness of tractography display, [-1.0, 1.0], default is 0.0.").allow_multiple() + Argument("value").type_float ( -1.0, 1.0 ) - + Option ("tractography.geometry_type", "The default geometry type used when rendering tractograms, default is Pseudotubes") - + Argument("value").type_choice (geom_types) + + Option ("tractography.geometry", "The geometry type to use when rendering tractograms (options are: " + join(tractogram_geometry_types, ", ") + ")") + + Argument("value").type_choice (tractogram_geometry_types) + Option ("tractography.opacity", "Opacity of tractography display, [0.0, 1.0], default is 1.0.").allow_multiple() + Argument("value").type_float ( 0.0, 1.0 ) @@ -821,15 +825,12 @@ namespace MR + Option ("tractography.tsf_load", "Load the specified tractography scalar file.").allow_multiple() + Argument("tsf").type_file_in() - + + Option ("tractography.tsf_range", "Set range for the tractography scalar file. Requires tractography.tsf_load already provided. RangeMin,RangeMax").allow_multiple() + Argument("range").type_sequence_float() + Option ("tractography.tsf_thresh", "Set thresholds for the tractography scalar file. Requires tractography.tsf_load already provided. ThresholdMin,ThesholdMax").allow_multiple() - + Argument("thresh").type_sequence_float() - ; - - + + Argument("thresh").type_sequence_float(); } /* @@ -863,21 +864,21 @@ namespace MR if (opt.opt->is ("tractography.tsf_load")) { try { - + if (process_commandline_option_tsf_check_tracto_loaded()) { QModelIndexList indices = tractogram_list_view->selectionModel()->selectedIndexes(); - + if (indices.size() == 1) {//just in case future edits break this assumption Tractogram* tractogram = tractogram_list_model->get_tractogram (indices[0]); - + //set its tsf filename and load the tsf file scalar_file_options->set_tractogram (tractogram); scalar_file_options->open_intensity_track_scalar_file_slot (std::string(opt[0])); - + //Set the GUI to use the file for visualisation colour_combobox->setCurrentIndex(4); // Set combobox to "File" } - } + } } catch (Exception& E) { E.display(); } @@ -889,20 +890,20 @@ namespace MR try { //Set the tsf visualisation range vector range; - if (process_commandline_option_tsf_option(opt,2, range)) + if (process_commandline_option_tsf_option(opt,2, range)) scalar_file_options->set_scaling (range[0], range[1]); } catch (Exception& E) { E.display(); } return true; } - + if (opt.opt->is ("tractography.tsf_thresh")) { try { //Set the tsf visualisation threshold vector range; - if (process_commandline_option_tsf_option(opt,2, range)) + if (process_commandline_option_tsf_option(opt,2, range)) scalar_file_options->set_threshold (TrackThresholdType::UseColourFile,range[0], range[1]); } catch(Exception& E) { E.display(); } @@ -922,10 +923,18 @@ namespace MR } - if (opt.opt-> is ("tractography.geometry_type")) { - const std::string geom_type = opt[0]; + + if (opt.opt-> is ("tractography.geometry")) { try { - init_geometry_type (geom_type); + const TrackGeometryType geom_type = geometry_index2type (geometry_string2index (opt[0])); + QModelIndexList indices = tractogram_list_view->selectionModel()->selectedIndexes(); + if (indices.size()) { + for (int i = 0; i < indices.size(); ++i) + tractogram_list_model->get_tractogram (indices[i])->set_geometry_type (geom_type); + } else { + Tractogram::default_tract_geom = geom_type; + } + update_geometry_type_gui(); } catch (Exception& E) { E.display(); } return true; @@ -981,7 +990,7 @@ namespace MR - + /*Checks whether legal to apply tsf options and prepares the scalar_file_options to do so. Returns the vector of floats parsed from the options, or null on fail*/ bool Tractography::process_commandline_option_tsf_option(const MR::App::ParsedOption& opt, uint reqArgSize, vector& range) { diff --git a/src/gui/mrview/tool/tractography/tractography.h b/src/gui/mrview/tool/tractography/tractography.h index 63c0193067..8d090a7e00 100644 --- a/src/gui/mrview/tool/tractography/tractography.h +++ b/src/gui/mrview/tool/tractography/tractography.h @@ -37,6 +37,8 @@ namespace MR namespace Tool { + extern const char* tractogram_geometry_types[]; + class Tractography : public Base { MEMALIGN(Tractography) Q_OBJECT @@ -111,14 +113,13 @@ namespace MR QSlider* thickness_slider; QLabel* thickness_label; - + void dropEvent (QDropEvent* event) override; void update_scalar_options(); void add_tractogram (vector& list); void select_last_added_tractogram(); bool process_commandline_option_tsf_check_tracto_loaded (); bool process_commandline_option_tsf_option (const MR::App::ParsedOption&, uint, vector& range); - void init_geometry_type(const std::string& type_str); void update_geometry_type_gui(); }; } From 4a64cd0b981499aa7818bb56793d0de8199fe819 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 30 Aug 2017 11:20:09 +1000 Subject: [PATCH 119/538] mrview Tractography tool: Enable ComboBoxWithErrorMsg functionality for geometry --- .../mrview/tool/tractography/tractography.cpp | 46 +++++++++++-------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/src/gui/mrview/tool/tractography/tractography.cpp b/src/gui/mrview/tool/tractography/tractography.cpp index d64c7cc775..aeef305f63 100644 --- a/src/gui/mrview/tool/tractography/tractography.cpp +++ b/src/gui/mrview/tool/tractography/tractography.cpp @@ -671,6 +671,11 @@ namespace MR void Tractography::geom_type_selection_slot (int selected_index) { + // Combo box shows the "(variable)" message, and the user has + // re-clicked on it -> nothing to do + if (selected_index == 3) + return; + TrackGeometryType geom_type = geometry_index2type (selected_index); QModelIndexList indices = tractogram_list_view->selectionModel()->selectedIndexes(); @@ -701,13 +706,14 @@ namespace MR TrackColourType color_type = first_tractogram->get_color_type(); Eigen::Array3f color = first_tractogram->colour; - bool color_type_consistent = true; + TrackGeometryType geom_type = first_tractogram->get_geometry_type(); + bool color_type_consistent = true, geometry_type_consistent = true; for (int i = 1; i != indices.size(); ++i) { const Tractogram* tractogram = tractogram_list_model->get_tractogram (indices[i]); - if (tractogram->get_color_type() != color_type) { + if (tractogram->get_color_type() != color_type) color_type_consistent = false; - break; - } + if (tractogram->get_geometry_type() != geom_type) + geometry_type_consistent = false; } if (color_type_consistent) { colour_combobox->blockSignals (true); @@ -736,22 +742,24 @@ namespace MR colour_combobox->setError(); } - TrackGeometryType geom_type = first_tractogram->get_geometry_type(); - int geom_combobox_index = 0; - switch (geom_type) { - case TrackGeometryType::Pseudotubes: - break; - case TrackGeometryType::Lines: - geom_combobox_index = 1; - break; - case TrackGeometryType::Points: - geom_combobox_index = 2; - break; - default: - assert (0); - break; + if (geometry_type_consistent) { + geom_type_combobox->blockSignals (true); + switch (geom_type) { + case TrackGeometryType::Pseudotubes: + geom_type_combobox->setCurrentIndex (0); + break; + case TrackGeometryType::Lines: + geom_type_combobox->setCurrentIndex (1); + break; + case TrackGeometryType::Points: + geom_type_combobox->setCurrentIndex (2); + break; + } + geom_type_combobox->clearError(); + geom_type_combobox->blockSignals (false); + } else { + geom_type_combobox->setError(); } - geom_type_combobox->setCurrentIndex(geom_combobox_index); thickness_slider->setSliderPosition (first_tractogram->line_thickness); } From 3ffb20e023f7db693e5fae0e69aa32102aed63d6 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 30 Aug 2017 13:35:00 +1000 Subject: [PATCH 120/538] mrview Tractography tool: Thickness changes - Move line thickness slider from general options to tractogram-specific options. When selecting multiple tractograms, set the thickness slider position according to the mean of the thicknesses of those tractograms selected; but do not alter their thicknesses unless the slider is moved by the user. --- .../mrview/tool/tractography/tractogram.cpp | 4 +-- .../mrview/tool/tractography/tractography.cpp | 29 +++++++++++++------ .../mrview/tool/tractography/tractography.h | 6 ++-- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/gui/mrview/tool/tractography/tractogram.cpp b/src/gui/mrview/tool/tractography/tractogram.cpp index 9507c56cf2..7104530ab2 100644 --- a/src/gui/mrview/tool/tractography/tractogram.cpp +++ b/src/gui/mrview/tool/tractography/tractogram.cpp @@ -231,7 +231,7 @@ namespace MR source += using_geom ? "in float g_amp;\n" : "in vec3 v_amp;\n"; if (use_lighting && (using_geom || using_points)) { - source += + source += "uniform float ambient, diffuse, specular, shine;\n" "uniform vec3 light_pos;\n"; @@ -475,7 +475,7 @@ namespace MR gl::BlendFunc (gl::CONSTANT_ALPHA, gl::ONE); gl::Disable (gl::DEPTH_TEST); gl::DepthMask (gl::TRUE_); - gl::BlendColor (1.0, 1.0, 1.0, tractography_tool.line_opacity / 0.5); + gl::BlendColor (1.0, 1.0, 1.0, tractography_tool.line_opacity / 0.5); render_streamlines(); gl::BlendFunc (gl::CONSTANT_ALPHA, gl::ONE_MINUS_CONSTANT_ALPHA); gl::Enable (gl::DEPTH_TEST); diff --git a/src/gui/mrview/tool/tractography/tractography.cpp b/src/gui/mrview/tool/tractography/tractography.cpp index aeef305f63..b1588e574f 100644 --- a/src/gui/mrview/tool/tractography/tractography.cpp +++ b/src/gui/mrview/tool/tractography/tractography.cpp @@ -196,6 +196,21 @@ namespace MR main_box->addLayout (hlayout); + hlayout = new HBoxLayout; + hlayout->setContentsMargins (0, 0, 0, 0); + hlayout->setSpacing (0); + + thickness_label = new QLabel ("thickness"); + hlayout->addWidget (thickness_label); + + thickness_slider = new QSlider (Qt::Horizontal); + thickness_slider->setRange (-1000,1000); + thickness_slider->setSliderPosition (0); + connect (thickness_slider, SIGNAL (valueChanged (int)), this, SLOT (line_thickness_slot (int))); + hlayout->addWidget (thickness_slider); + + main_box->addLayout (hlayout); + scalar_file_options = new TrackScalarFileOptions (this); main_box->addWidget (scalar_file_options); @@ -213,14 +228,6 @@ namespace MR general_opt_grid->addWidget (new QLabel ("opacity"), 0, 0); general_opt_grid->addWidget (opacity_slider, 0, 1); - thickness_slider = new QSlider (Qt::Horizontal); - thickness_slider->setRange (-1000,1000); - thickness_slider->setSliderPosition (0); - connect (thickness_slider, SIGNAL (valueChanged (int)), this, SLOT (line_thickness_slot (int))); - thickness_label = new QLabel ("thickness"); - general_opt_grid->addWidget (thickness_label, 1, 0); - general_opt_grid->addWidget (thickness_slider, 1, 1); - slab_group_box = new QGroupBox (tr("crop to slab")); slab_group_box->setCheckable (true); slab_group_box->setChecked (true); @@ -708,12 +715,14 @@ namespace MR Eigen::Array3f color = first_tractogram->colour; TrackGeometryType geom_type = first_tractogram->get_geometry_type(); bool color_type_consistent = true, geometry_type_consistent = true; + float mean_thickness = first_tractogram->line_thickness; for (int i = 1; i != indices.size(); ++i) { const Tractogram* tractogram = tractogram_list_model->get_tractogram (indices[i]); if (tractogram->get_color_type() != color_type) color_type_consistent = false; if (tractogram->get_geometry_type() != geom_type) geometry_type_consistent = false; + mean_thickness += tractogram->line_thickness; } if (color_type_consistent) { colour_combobox->blockSignals (true); @@ -761,7 +770,9 @@ namespace MR geom_type_combobox->setError(); } - thickness_slider->setSliderPosition (first_tractogram->line_thickness); + thickness_slider->blockSignals (true); + thickness_slider->setSliderPosition (mean_thickness / float(indices.size())); + thickness_slider->blockSignals (false); } diff --git a/src/gui/mrview/tool/tractography/tractography.h b/src/gui/mrview/tool/tractography/tractography.h index 8d090a7e00..f52d2931a1 100644 --- a/src/gui/mrview/tool/tractography/tractography.h +++ b/src/gui/mrview/tool/tractography/tractography.h @@ -102,6 +102,9 @@ namespace MR ComboBoxWithErrorMsg *geom_type_combobox; + QLabel* thickness_label; + QSlider* thickness_slider; + TrackScalarFileOptions *scalar_file_options; LightingDock *lighting_dock; @@ -110,9 +113,6 @@ namespace MR QPushButton* lighting_button; QSlider* opacity_slider; - QSlider* thickness_slider; - - QLabel* thickness_label; void dropEvent (QDropEvent* event) override; void update_scalar_options(); From e7736299f7580ad61159e48c6907312f83fb13c5 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 30 Aug 2017 15:44:25 +1000 Subject: [PATCH 121/538] mrtrix3.app: More standard option checking Follows on from 09c1f21. If some external script erases the standard option set, then these variables may not exist at time of reading; therefore need to explicitly check for their existence. --- lib/mrtrix3/app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index 0402113255..285086f935 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -185,7 +185,7 @@ def checkOutputPath(path): type = ' file' elif os.path.isdir(abspath): type = ' directory' - if args.force: + if hasattr(args, 'force') and args.force: warn('Output' + type + ' \'' + path + '\' already exists; will be overwritten at script completion') force = True else: @@ -198,12 +198,12 @@ def makeTempDir(): import os, random, string, sys global args, config global _tempDir, _workingDir - if args.cont: + if hasattr(args, 'cont') and args.cont: debug('Skipping temporary directory creation due to use of -continue option') return if _tempDir: error('Script error: Cannot use multiple temporary directories') - if args.tempdir: + if hasattr(args, 'tempdir') and args.tempdir: dir_path = os.path.abspath(args.tempdir) else: if 'ScriptTmpDir' in config: From 311f2483e3f8c02285a5fcfd26506b83419e053f Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Thu, 31 Aug 2017 17:29:20 +1000 Subject: [PATCH 122/538] ongoing docs work --- .../response_function_estimation.rst | 81 ++++++++++--------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/docs/constrained_spherical_deconvolution/response_function_estimation.rst b/docs/constrained_spherical_deconvolution/response_function_estimation.rst index 4ee816f2ba..0e80fc8e4c 100644 --- a/docs/constrained_spherical_deconvolution/response_function_estimation.rst +++ b/docs/constrained_spherical_deconvolution/response_function_estimation.rst @@ -49,8 +49,8 @@ In general, it's always worthwhile checking your response function(s): Use the left and right arrow (keyboard) keys in this viewer to switch between the different b-values ('shells') of the response function, if -it has more than one (this would for example be the case for the outputs -of the ``dhollander`` algorithm). +it has more than one b-value (this would for example be the case for +the outputs of the ``dhollander`` algorithm). It may also be helpful to check which voxels were selected by the algorithm to estimate the response function(s) from. For any @@ -65,47 +65,46 @@ the ``tournier`` algorithm: The resulting ``voxels.mif`` image can be overlaid on the ``dwi.mif`` dataset using the :ref:`mrview` image viewer for further inspection. - -More information ----------------- - -Looking at the process of response function estimation in full detail, -there are four crucial steps. For each of these, I will also briefly -mention the typical process used. - -1. Select those image voxels that are to be used when determining the - response function - the 'single-fibre mask'. *Typical*: Varies. - -2. Estimate the direction of the underlying fibres in each voxel. - *Typical*: Often the diffusion tensor fit is still used for this - purpose; though CSD itself can also be used as long as an initial - response function estimate is available. - -3. Rotate the signal measured in each single-fibre voxel in such a way - that the estimated fibre direction coincides with the z-axis. - *Typical*: This may be done by rotating the diffusion gradient table - according to the estimated fibre direction; or if the diffusion - signal is converted to spherical harmonics, then a spherical - convolution can be used. - -4. Combine these signals to produce a single response function. - *Typical*: The ``m=0`` terms of the spherical harmonic series (which - are rotationally symmetric about the z-axis) are simply averaged - across single-fibre voxels. - -Of these steps, the first is the one that has caused the greatest -difficulty, and is also the principle mechanism where the provided -response function estimation algorithms vary. It will therefore be the -primary focus of this document, though note that the other aspects of -this process may also change with ongoing development. - -``dwi2response`` algorithms ---------------------------- +All available algorithms +------------------------ + +The available algorithms differ in a few general properties, related +to what they deliver (as output) and require (as input), notably + +- whether they only estimate a single-fibre white matter response + function (``tournier``, ``tax`` and ``fa``) or also additional + response functions for other tissue types (``dhollander`` and + ``msmt_5tt`` both output a single-fibre white matter response + function as well as grey matter and CSF response functions) + +- whether they only output response function(s) for a single b-value + (``tournier``, ``tax`` and `fa``) or for all—or a selection—of + b-values (``dhollander`` and ``msmt_5tt``) + +- whether they only require the DWI dataset as input (``tournier``, + ``dhollander``, ``tax`` and ``fa``) or also additional input(s) + (``msmt_5tt`` requires a 5TT segmentation from a spatially + aligned anatomical image) + +Beyond these general categories, the algorithms differ mostly in how +they derive the voxels where to estimate the response function(s) from, +and to a lesser extent also how they derive the fibre orientation +for single-fibre voxels. + +The ``manual`` 'algorithm' is an exception to most of the above, in that +it allows/*requires* you to provide the voxels yourself, and even allows +you to provide single-fibre orientations manually as well. It should +only be considered in case of exceptional kinds of data, or otherwise +exceptional requirements. Caution is advised with respect to *interpretation* +of spherical deconvolution results using manually defined response +function(s). + +The following sections provide more details on each algorithm specifically. ``dhollander`` ^^^^^^^^^^^^^^ -TODO: Thijs is working on this documentation page. +TODO: Thijs is working on this documentation section. ``fa`` ^^^^^^ @@ -330,5 +329,7 @@ typically smaller. Writing your own algorithms --------------------------- -TODO: Thijs is working on this documentation page. +TODO: Thijs is working on this documentation section. Will suggest ``manual`` +as a first (easier) option, and (python) implementation of a ``dwi2response`` +algorithm as another (and mention in which folder the algos sit). From 31a114df1c42dcc87882856d444e09e842ed5140 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Thu, 31 Aug 2017 17:38:02 +1000 Subject: [PATCH 123/538] minor ongoing docs fixes --- .../response_function_estimation.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/constrained_spherical_deconvolution/response_function_estimation.rst b/docs/constrained_spherical_deconvolution/response_function_estimation.rst index 0e80fc8e4c..2d888df605 100644 --- a/docs/constrained_spherical_deconvolution/response_function_estimation.rst +++ b/docs/constrained_spherical_deconvolution/response_function_estimation.rst @@ -78,7 +78,7 @@ to what they deliver (as output) and require (as input), notably function as well as grey matter and CSF response functions) - whether they only output response function(s) for a single b-value - (``tournier``, ``tax`` and `fa``) or for all—or a selection—of + (``tournier``, ``tax`` and ``fa``) or for all—or a selection—of b-values (``dhollander`` and ``msmt_5tt``) - whether they only require the DWI dataset as input (``tournier``, @@ -87,12 +87,12 @@ to what they deliver (as output) and require (as input), notably aligned anatomical image) Beyond these general categories, the algorithms differ mostly in how -they derive the voxels where to estimate the response function(s) from, -and to a lesser extent also how they derive the fibre orientation -for single-fibre voxels. +they derive the voxels that will be used to estimate the response +function(s) from, and to a lesser extent also how they derive the fibre +orientation for single-fibre voxels. -The ``manual`` 'algorithm' is an exception to most of the above, in that -it allows/*requires* you to provide the voxels yourself, and even allows +The ``manual`` choice is an exception to most of the above, in that it +allows/*requires* you to provide the voxels yourself, and even allows you to provide single-fibre orientations manually as well. It should only be considered in case of exceptional kinds of data, or otherwise exceptional requirements. Caution is advised with respect to *interpretation* From 99c5879c094a62af1ed94689f69ea8ab25324f80 Mon Sep 17 00:00:00 2001 From: Max Pietsch Date: Sat, 2 Sep 2017 13:37:32 +0100 Subject: [PATCH 124/538] population_template: replace shutil.copy2 with shutil.copy to avoid metadata permission issues on windows forum: http://community.mrtrix.org/t/fixed-dwiintensitynorm-error-at-population-template/1131 --- bin/population_template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/population_template b/bin/population_template index 8989bcc99b..bfe259794c 100755 --- a/bin/population_template +++ b/bin/population_template @@ -15,7 +15,7 @@ sys.path.insert(0, lib_folder) import shutil move = shutil.move -copy = shutil.copy2 +copy = shutil.copy copytree = shutil.copytree rmtree = shutil.rmtree remove = os.remove @@ -544,7 +544,7 @@ current_template = 'initial_template.mif' # Optimise template with linear registration if not dolinear: for i in input: - run.function(copy, os.path.join('linear_transforms_initial','%s.txt' % (i.prefix)), 'linear_transforms') + run.function(copy, os.path.join('linear_transforms_initial','%s.txt' % (i.prefix)), os.path.join('linear_transforms','%s.txt' % (i.prefix))) else: app.console('Optimising template with linear registration') for level in range(0, len(linear_scales)): @@ -628,7 +628,7 @@ else: current_template = 'linear_template' + str(level) + '.mif' for filename in os.listdir('linear_transforms_%i' % level): - run.function(copy, os.path.join('linear_transforms_%i' % level, filename), 'linear_transforms') + run.function(copy, os.path.join('linear_transforms_%i' % level, filename), os.path.join('linear_transforms', filename)) # Create a template mask for nl registration by taking the intersection of all transformed input masks and dilating if useMasks and (dononlinear or app.args.template_mask): From f24a4dfc0e96fb519fb116a800c3cfe51979c5f7 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Mon, 4 Sep 2017 14:53:00 +1000 Subject: [PATCH 125/538] ongoing userdocs updates --- .../response_function_estimation.rst | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/docs/constrained_spherical_deconvolution/response_function_estimation.rst b/docs/constrained_spherical_deconvolution/response_function_estimation.rst index 2d888df605..d4819c631a 100644 --- a/docs/constrained_spherical_deconvolution/response_function_estimation.rst +++ b/docs/constrained_spherical_deconvolution/response_function_estimation.rst @@ -71,20 +71,22 @@ All available algorithms The available algorithms differ in a few general properties, related to what they deliver (as output) and require (as input), notably -- whether they only estimate a single-fibre white matter response - function (``tournier``, ``tax`` and ``fa``) or also additional - response functions for other tissue types (``dhollander`` and - ``msmt_5tt`` both output a single-fibre white matter response - function as well as grey matter and CSF response functions) - -- whether they only output response function(s) for a single b-value - (``tournier``, ``tax`` and ``fa``) or for all—or a selection—of - b-values (``dhollander`` and ``msmt_5tt``) +- **single- versus multi-tissue**: whether they only estimate a + single-fibre white matter response function (``tournier``, ``tax`` + and ``fa``) or also additional response functions for other tissue + types (``dhollander`` and ``msmt_5tt`` both output a single-fibre + white matter response function as well as grey matter and CSF + response functions) + +- **single versus multiple b-values**: whether they only output + response function(s) for a single b-value (``tournier``, ``tax`` + and ``fa``) or for all—or a selection—of b-values (``dhollander`` + and ``msmt_5tt``) -- whether they only require the DWI dataset as input (``tournier``, - ``dhollander``, ``tax`` and ``fa``) or also additional input(s) - (``msmt_5tt`` requires a 5TT segmentation from a spatially - aligned anatomical image) +- **input requirements**: whether they only require the DWI dataset + as input (``tournier``, ``dhollander``, ``tax`` and ``fa``) or + also additional input(s) (``msmt_5tt`` requires a 5TT segmentation + from a spatially aligned anatomical image) Beyond these general categories, the algorithms differ mostly in how they derive the voxels that will be used to estimate the response From 01dc0e4e9660beb3e239c41453abd048d68eb96d Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Mon, 4 Sep 2017 17:14:12 +1000 Subject: [PATCH 126/538] ongoing userdocs updates --- .../response_function_estimation.rst | 51 ++++++++----------- 1 file changed, 20 insertions(+), 31 deletions(-) diff --git a/docs/constrained_spherical_deconvolution/response_function_estimation.rst b/docs/constrained_spherical_deconvolution/response_function_estimation.rst index d4819c631a..2a848c8de7 100644 --- a/docs/constrained_spherical_deconvolution/response_function_estimation.rst +++ b/docs/constrained_spherical_deconvolution/response_function_estimation.rst @@ -80,7 +80,7 @@ to what they deliver (as output) and require (as input), notably - **single versus multiple b-values**: whether they only output response function(s) for a single b-value (``tournier``, ``tax`` - and ``fa``) or for all—or a selection—of b-values (``dhollander`` + and ``fa``) or for all—or a selection of— b-values (``dhollander`` and ``msmt_5tt``) - **input requirements**: whether they only require the DWI dataset @@ -103,32 +103,21 @@ function(s). The following sections provide more details on each algorithm specifically. -``dhollander`` -^^^^^^^^^^^^^^ +``dhollander`` algorithm +^^^^^^^^^^^^^^^^^^^^^^^^ TODO: Thijs is working on this documentation section. -``fa`` -^^^^^^ +``fa`` algorithm +^^^^^^^^^^^^^^^^ -In the previous version of MRtrix ('0.2'), the following heuristic was -suggested in the documentation for deriving the response function: - -- Erode a brain mask by a few voxels, to omit any voxels near the edge - of the brain; - -- Select those voxels within the mask that have a Fractional Anisotropy - (FA) of 0.7 or greater; - -- The ``estimate_response`` command would then be used to generate a - response function, which would internally perform diffusion tensor - estimation to get the fibre directions as well as the gradient - reorientation. - -Rather than this series of commands, ``dwi2response`` now provides a -similar heuristic in-built as the ``fa`` algorithm. The primary -difference is that by default, it will instead select the 300 voxels -with the highest FA (though this can be modified at the command-line). +The ``fa`` algorithm is an implementation of the strategy proposed in +Tournier et al. (2004) to estimate a single b-value (single-shell) response +function for single-fibre white matter, which can subsequently be used +in single-tissue (constrained) spherical deconvolution. The algorithm +estimates this response function from the 300 voxels with the highest FA +value in an eroded brain mask. There are also options to change this +number or provide an absolute FA threshold. This algorithm is provided partly for nostalgic purposes, but it also highlights the range of possibilities for single-fbre voxel selection. @@ -138,8 +127,8 @@ matter regions close to CSF, Gibbs ringing can make the signal in *b=0* images erroneously low, which causes an artificial increase in FA, and therefore such voxels get included in the single-fibre mask. -``manual`` -^^^^^^^^^^ +``manual`` algorithm +^^^^^^^^^^^^^^^^^^^^ This algorithm is provided for cases where none of the available algorithms give adequate results, for deriving multi-shell multi-tissue @@ -150,8 +139,8 @@ manual definition of both the single-fibre voxel mask (or just a voxel mask for isotropic tissues); the fibre directions can also be provided manually if necessary (otherwise a tensor fit will be used). -``msmt_5tt`` -^^^^^^^^^^^^ +``msmt_5tt`` algorithm +^^^^^^^^^^^^^^^^^^^^^^ This algorithm is intended for deriving multi-shell, multi-tissue response functions that are compatible with the new Multi-Shell @@ -190,8 +179,8 @@ For reference, this algorithm operates as follows: 4. Derive a multi-shell response for each tissue for each of these three tissues. For GM and CSF, use *lmax=0* for all shells. -``tax`` -^^^^^^^ +``tax`` algorithm +^^^^^^^^^^^^^^^^^ This algorithm is a fairly accurate reimplementation of the approach proposed by `Tax et @@ -288,8 +277,8 @@ that were made to the algorithm as part of the earlier ``dwi2response`` view, it has been excluded from the new ``dwi2response`` script to keep things as simple as possible. -``tournier`` -^^^^^^^^^^^^ +``tournier`` algorithm +^^^^^^^^^^^^^^^^^^^^^^ Independently and in parallel, Donald also developed a newer method for response function estimation based on CSD itself; it was used in `this From db725fbfb8d9d58b317e0ab156647c245ad8f914 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 4 Sep 2017 18:04:57 +1000 Subject: [PATCH 127/538] Revert threading changes for dynamic seeding Return to using maximum available number of threads for both tracking and streamline mapping stages. Under default usage, all tracking threads will be used fully, with the mapping stage only increasing total CPU usage by a small amount. Therefore, reducing the number of threads available for the streamlines algorithm is unnecessarily punitive in trying to prevent a greater usage of the command than may be expected due to use of the -nthreads option. The mapping stage is however still multi-threaded, since a very fast tracking algorithm could conceivably require more than one mapping thread; if these are not used, the threads will simply remain inactive. --- src/dwi/tractography/tracking/exec.h | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/dwi/tractography/tracking/exec.h b/src/dwi/tractography/tracking/exec.h index 42896fa667..f4a04e97c3 100644 --- a/src/dwi/tractography/tracking/exec.h +++ b/src/dwi/tractography/tracking/exec.h @@ -92,21 +92,12 @@ namespace MR mapper.set_upsample_ratio (Mapping::determine_upsample_ratio (fod_data, properties, 0.25)); mapper.set_use_precise_mapping (true); - // If the user has explicitly requested no more than a set number of threads, - // then split that number of threads between the tracking and mapping steps. - // If however the number of threads has been implicitly calculated based on - // hardware concurrency, then spawn that number of threads for both stages, - // and let the system deal with balancing the load. - const size_t nthreads = MR::Thread::type_nthreads() == MR::Thread::nthreads_t::EXPLICIT ? - MR::Thread::number_of_threads()/2 : - MR::Thread::number_of_threads(); - Thread::run_queue ( - Thread::multi (tracker, nthreads), + Thread::multi (tracker), Thread::batch (GeneratedTrack(), TRACKING_BATCH_SIZE), writer, Thread::batch (Streamline<>(), TRACKING_BATCH_SIZE), - Thread::multi (mapper, nthreads), + Thread::multi (mapper), Thread::batch (SetDixel(), TRACKING_BATCH_SIZE), *seeder); From d2476fd0093acd224d14d35de7eb8a0e9f0cf7f6 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 4 Sep 2017 18:36:45 +1000 Subject: [PATCH 128/538] thread.h: Remove description of prior usage --- core/thread.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/thread.h b/core/thread.h index 3e7faadac4..7058ba52d3 100644 --- a/core/thread.h +++ b/core/thread.h @@ -244,10 +244,7 @@ namespace MR /*! provides information regarding whether the number of threads has been * initialised, set explicitly, or determined implicitly. This may affect * how particular algorithms choose to launch threads depending on the - * presence of a user request. It also prevents repeated testing of - * config file / environment variables, since 0 was previously used both - * as an indication of being uninitialised as well as being a valid value - * (indicates purely single-threaded operation). */ + * presence of a user request. */ enum class nthreads_t { UNINITIALISED, EXPLICIT, IMPLICIT }; nthreads_t type_nthreads (); From 5b3574b8db95e234b79c2299955648892e5ed03d Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Tue, 5 Sep 2017 17:05:27 +1000 Subject: [PATCH 129/538] ongoing userdocs --- .../response_function_estimation.rst | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/constrained_spherical_deconvolution/response_function_estimation.rst b/docs/constrained_spherical_deconvolution/response_function_estimation.rst index 2a848c8de7..86dbda9dbe 100644 --- a/docs/constrained_spherical_deconvolution/response_function_estimation.rst +++ b/docs/constrained_spherical_deconvolution/response_function_estimation.rst @@ -112,12 +112,15 @@ TODO: Thijs is working on this documentation section. ^^^^^^^^^^^^^^^^ The ``fa`` algorithm is an implementation of the strategy proposed in -Tournier et al. (2004) to estimate a single b-value (single-shell) response -function for single-fibre white matter, which can subsequently be used -in single-tissue (constrained) spherical deconvolution. The algorithm -estimates this response function from the 300 voxels with the highest FA -value in an eroded brain mask. There are also options to change this -number or provide an absolute FA threshold. +`Tournier et al. (2004) `__. +to estimate a single b-value (single-shell) response function for +single-fibre white matter, which can subsequently be used in single-tissue +(constrained) spherical deconvolution. The algorithm estimates this +response function from the 300 voxels with the highest FA value in an +eroded brain mask. There are also options to change this number or +provide an absolute FA threshold. + + This algorithm is provided partly for nostalgic purposes, but it also highlights the range of possibilities for single-fbre voxel selection. @@ -183,8 +186,7 @@ For reference, this algorithm operates as follows: ^^^^^^^^^^^^^^^^^ This algorithm is a fairly accurate reimplementation of the approach -proposed by `Tax et -al. `__. +proposed by `Tax et al. `__. The operation of the algorithm can be summarized as follows: 1. Initialise the response function using a relatively 'fat' profile, From 5687708623505a4870dc42cadf411a25339f1144 Mon Sep 17 00:00:00 2001 From: Max Pietsch Date: Tue, 5 Sep 2017 17:00:22 +0100 Subject: [PATCH 130/538] mrview: pan_event: removed updateGL() which causes pan gestures to remain in state Qt::GestureUpdated, never reaching Qt::GestureFinished on macOS #761. no negative side effects - I think --- src/gui/mrview/mode/base.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gui/mrview/mode/base.cpp b/src/gui/mrview/mode/base.cpp index 2709e2d26a..10aacf2ab9 100644 --- a/src/gui/mrview/mode/base.cpp +++ b/src/gui/mrview/mode/base.cpp @@ -150,7 +150,7 @@ namespace MR void Base::mouse_press_event () { } void Base::mouse_release_event () { } - void Base::slice_move_event (float x) + void Base::slice_move_event (float x) { const Projection* proj = get_current_projection(); if (!proj) return; @@ -191,7 +191,7 @@ namespace MR const Projection* proj = get_current_projection(); if (!proj) return; set_target (target() - proj->screen_to_model_direction (window().mouse_displacement(), target())); - updateGL(); + // updateGL(); # updateGL() causes pan gestures to remain in state Qt::GestureUpdated, never reaching Qt::GestureFinished on macOS } @@ -265,18 +265,18 @@ namespace MR Math::Versorf Base::get_rotate_rotation () const { const Projection* proj = get_current_projection(); - if (!proj) + if (!proj) return Math::Versorf(); QPoint dpos = window().mouse_displacement(); - if (dpos.x() == 0 && dpos.y() == 0) + if (dpos.x() == 0 && dpos.y() == 0) return Math::Versorf(); Eigen::Vector3f x1 (window().mouse_position().x() - proj->x_position() - proj->width()/2, window().mouse_position().y() - proj->y_position() - proj->height()/2, 0.0); - if (x1.norm() < 16.0f) + if (x1.norm() < 16.0f) return Math::Versorf(); Eigen::Vector3f x0 (dpos.x() - x1[0], dpos.y() - x1[1], 0.0); @@ -296,7 +296,7 @@ namespace MR void Base::tilt_event () { - if (snap_to_image()) + if (snap_to_image()) window().set_snap_to_image (false); const Math::Versorf rot = get_tilt_rotation(); @@ -313,7 +313,7 @@ namespace MR void Base::rotate_event () { - if (snap_to_image()) + if (snap_to_image()) window().set_snap_to_image (false); const Math::Versorf rot = get_rotate_rotation(); @@ -330,14 +330,14 @@ namespace MR - void Base::reset_event () - { + void Base::reset_event () + { reset_view(); updateGL(); } - void Base::reset_view () + void Base::reset_view () { if (!image()) return; const Projection* proj = get_current_projection(); From 0aff2e7b0f7a88c2b0e1bd1eb513f5caa1867ee4 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Tue, 5 Sep 2017 23:12:21 +0100 Subject: [PATCH 131/538] testing for population_template: use 'tmp' prefix for temporaries Any file or folder starting with 'tmp' will be automatically cleaned up by the run_tests script, and is also ignored in the testing repo's .gitignore. This change avoids leftover folders from a failed population_template test leading to a dirty status, which influences the version string on subsequent builds. --- testing/tests/population_template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/tests/population_template b/testing/tests/population_template index a434b3fe47..1f98e160b8 100644 --- a/testing/tests/population_template +++ b/testing/tests/population_template @@ -1,2 +1,2 @@ -population_template population_template/in population_template/out.mif.gz -type rigid_nonlinear -rigid_scale 0.2,0.3 -rigid_niter 20,20 -nl_scale 0.2,0.3 -nl_niter 1,1 -force && rm population_template/out.mif.gz -population_template population_template/in population_template/out.mif.gz -type nonlinear -nl_scale 0.2,0.3 -nl_niter 1,1 -force && rm population_template/out.mif.gz +population_template population_template/in tmp-population_template-out.mif.gz -type rigid_nonlinear -rigid_scale 0.2,0.3 -rigid_niter 20,20 -nl_scale 0.2,0.3 -nl_niter 1,1 -tempdir tmp-population_template -force +population_template population_template/in tmp-population_template-out.mif.gz -type nonlinear -nl_scale 0.2,0.3 -nl_niter 1,1 -tempdir tmp-population_template -force From c59a2300f0233a316e5485b4fdf4fef13aa2c634 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Tue, 5 Sep 2017 23:33:24 +0100 Subject: [PATCH 132/538] population_template: fix Python3 compatibility issue --- bin/population_template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/population_template b/bin/population_template index bfe259794c..b529fae77b 100755 --- a/bin/population_template +++ b/bin/population_template @@ -59,7 +59,7 @@ except ImportError: fmt = [fmt, ] * ncol format = delimiter.join(fmt) for row in X: - fh.write((format % tuple(row) + '\n')) + fh.write((format % tuple(row) + '\n').encode (errors='ignore')) finally: fh.close() From b02d82f9052176bb8e361604827fd09b6d2f1cc6 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Tue, 5 Sep 2017 23:33:56 +0100 Subject: [PATCH 133/538] update testing data repo SHA1 --- testing/data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/data b/testing/data index 72e0a40550..5e0f3ccb63 160000 --- a/testing/data +++ b/testing/data @@ -1 +1 @@ -Subproject commit 72e0a4055092a9f180fd77a7f6096df90b7622c0 +Subproject commit 5e0f3ccb63ef2bdea941092ccd017b4af94dcc5d From 9faaf1893d942d063730fa736385845b9a0ec5b4 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Tue, 5 Sep 2017 23:42:29 +0100 Subject: [PATCH 134/538] population_template: use different temporary folder for each test --- testing/tests/population_template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/tests/population_template b/testing/tests/population_template index 1f98e160b8..0def036b22 100644 --- a/testing/tests/population_template +++ b/testing/tests/population_template @@ -1,2 +1,2 @@ population_template population_template/in tmp-population_template-out.mif.gz -type rigid_nonlinear -rigid_scale 0.2,0.3 -rigid_niter 20,20 -nl_scale 0.2,0.3 -nl_niter 1,1 -tempdir tmp-population_template -force -population_template population_template/in tmp-population_template-out.mif.gz -type nonlinear -nl_scale 0.2,0.3 -nl_niter 1,1 -tempdir tmp-population_template -force +population_template population_template/in tmp-population_template-out.mif.gz -type nonlinear -nl_scale 0.2,0.3 -nl_niter 1,1 -tempdir tmp-population_template2 -force From 27e8e7cffbf54c4aa604c13320d740b3e15bfc98 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Wed, 6 Sep 2017 11:49:44 +1000 Subject: [PATCH 135/538] ongoing docs --- .../response_function_estimation.rst | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/constrained_spherical_deconvolution/response_function_estimation.rst b/docs/constrained_spherical_deconvolution/response_function_estimation.rst index 86dbda9dbe..fae1fccfe1 100644 --- a/docs/constrained_spherical_deconvolution/response_function_estimation.rst +++ b/docs/constrained_spherical_deconvolution/response_function_estimation.rst @@ -111,7 +111,7 @@ TODO: Thijs is working on this documentation section. ``fa`` algorithm ^^^^^^^^^^^^^^^^ -The ``fa`` algorithm is an implementation of the strategy proposed in +This algorithm is an implementation of the strategy proposed in `Tournier et al. (2004) `__. to estimate a single b-value (single-shell) response function for single-fibre white matter, which can subsequently be used in single-tissue @@ -120,15 +120,14 @@ response function from the 300 voxels with the highest FA value in an eroded brain mask. There are also options to change this number or provide an absolute FA threshold. +Due to relying *only* on FA values, this strategy is relatively +limited in its abilities to select the best voxels. In white matter +close to CSF, for example, Gibbs ringing can severely affect FA values. +More advanced iterative strategies, such as the ``tournier`` and ``tax`` +algorithms have been proposed in the mean time. - -This algorithm is provided partly for nostalgic purposes, but it also -highlights the range of possibilities for single-fbre voxel selection. -One of the problems associated with this approach (over and above the -feeling of uncleanliness from using the tensor model) is that in white -matter regions close to CSF, Gibbs ringing can make the signal in *b=0* -images erroneously low, which causes an artificial increase in FA, and -therefore such voxels get included in the single-fibre mask. +For more information, refer to the +:ref:`fa algorithm documentation `. ``manual`` algorithm ^^^^^^^^^^^^^^^^^^^^ From 890c5d2b92aa3061ea0c87159c135218dabeca02 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Wed, 6 Sep 2017 16:14:21 +1000 Subject: [PATCH 136/538] ongoing docs --- .../response_function_estimation.rst | 139 ++++-------------- 1 file changed, 31 insertions(+), 108 deletions(-) diff --git a/docs/constrained_spherical_deconvolution/response_function_estimation.rst b/docs/constrained_spherical_deconvolution/response_function_estimation.rst index fae1fccfe1..b596d04769 100644 --- a/docs/constrained_spherical_deconvolution/response_function_estimation.rst +++ b/docs/constrained_spherical_deconvolution/response_function_estimation.rst @@ -103,16 +103,16 @@ function(s). The following sections provide more details on each algorithm specifically. -``dhollander`` algorithm -^^^^^^^^^^^^^^^^^^^^^^^^ +'dhollander' algorithm +^^^^^^^^^^^^^^^^^^^^^^ TODO: Thijs is working on this documentation section. -``fa`` algorithm -^^^^^^^^^^^^^^^^ +'fa' algorithm +^^^^^^^^^^^^^^ This algorithm is an implementation of the strategy proposed in -`Tournier et al. (2004) `__. +`Tournier et al. (2004) `__ to estimate a single b-value (single-shell) response function for single-fibre white matter, which can subsequently be used in single-tissue (constrained) spherical deconvolution. The algorithm estimates this @@ -129,8 +129,8 @@ algorithms have been proposed in the mean time. For more information, refer to the :ref:`fa algorithm documentation `. -``manual`` algorithm -^^^^^^^^^^^^^^^^^^^^ +'manual' algorithm +^^^^^^^^^^^^^^^^^^ This algorithm is provided for cases where none of the available algorithms give adequate results, for deriving multi-shell multi-tissue @@ -141,8 +141,8 @@ manual definition of both the single-fibre voxel mask (or just a voxel mask for isotropic tissues); the fibre directions can also be provided manually if necessary (otherwise a tensor fit will be used). -``msmt_5tt`` algorithm -^^^^^^^^^^^^^^^^^^^^^^ +'msmt_5tt' algorithm +^^^^^^^^^^^^^^^^^^^^ This algorithm is intended for deriving multi-shell, multi-tissue response functions that are compatible with the new Multi-Shell @@ -181,105 +181,28 @@ For reference, this algorithm operates as follows: 4. Derive a multi-shell response for each tissue for each of these three tissues. For GM and CSF, use *lmax=0* for all shells. -``tax`` algorithm -^^^^^^^^^^^^^^^^^ - -This algorithm is a fairly accurate reimplementation of the approach -proposed by `Tax et al. `__. -The operation of the algorithm can be summarized as follows: - -1. Initialise the response function using a relatively 'fat' profile, - and the single-fibre mask using all brain voxels. - -2. Perform CSD in all single-fibre voxels. - -3. Exclude from the single-fibre voxel mask those voxels where the - resulting FOD detects more than one discrete fibre population, e.g. - using the ratio of the amplitudes of the first and second tallest - peaks. - -4. Re-calculate the response function using the updated single-fibre - voxel mask. - -5. Return to step 2, repeating until some termination criterion is - achieved. - -The following are the differences between the implementation in -``dwi2response`` and this manuscript: - -- Deriving the initial response function. In the manuscript, this is - done using a tensor model with a low FA. I wasn't fussed on this - approach myself, in part because it's difficult to get the correct - intensity sscaling. Instead, the script examines the mean and - standard deviation of the raw DWI volumes, and derives an initial - *lmax=4* response function based on these. - -- The mechanism used to identify the peaks of the FOD. In - ``dwi2response``, the FOD segmentation algorithm described in the - `SIFT paper (Appendix - 2) `__ - is used to locate the FOD peaks. The alternative is to use the - :ref:`sh2peaks` command, which uses a Newton search from 60 pre-defined - directions to locate these peaks. In my experience, the latter is - slower, and may fail to identify some FOD peaks because the seeding - directions are not sufficiently dense. - -For the sake of completeness, the following are further modifications -that were made to the algorithm as part of the earlier ``dwi2response`` -*binary*, but have been removed from the script as it is now provided: - -- Rather than using the ratio of amplitudes between the tallest and - second-tallest peaks, this command instead looked at the ratio of the - AFD of the largest FOD lobe, and the sum of the AFD of all other - (positive) lobes in the voxel. Although this in some way makes more - sense from a physical perspective (comparing the volume occupied by - the primary fibre bundle to the volume of 'everything else'), it's - possible that due to the noisy nature of the FODs at small - amplitudes, this may have only introduced variance into the - single-fibre voxel identification process. Therefore the script has - reverted to the original & simpler peak amplitude ratio calculation. - -- A second, more stringent pass of SF voxel exclusion was performed, - which introduced two more criteria that single-fibre voxels had to - satisfy: - -- Dispersion: A measure of dispersion of an FOD lobe can be derived as - the ratio between the integral (fibre volume) and the peak amplitude. - As fibre dispersion increases, the FOD peak amplitude decreases, but - the fibre volume is unaffected; therefore this ratio increases. The - goal here was to explicitly exclude voxels from the single-fibre mask - if significant orientation dispersion was observed; this can be taken - into account somewhat by using the FOD peak amplitudes (as - orientation dispersion will decrease the amplitude of the tallest - peak), but from my initial experimentation I wanted something more - stringent. However as before, given the difficulties that many users - experienced with the ``dwi2response`` command, this algorithm in the - new script errs on the side of simplicity, so this test is not - performed. - -- Integral: By testing only the ratio of the tallest to second-tallest - FOD peak amplitude, the absolute value of the peak amplitude is - effectively ignored. This may or may not be considered problematic, - for either small or large FOD amplitudes. If the peak amplitude / AFD - is smaller than that of other voxels, it's possible that this voxel - experiences partial volume with CSF: this may satisfy the peak ratio - requirement, but using such a voxel is not ideal in response function - estimation as its noise level will be higher and the Rician noise - bias will be different. Conversely, both in certain regions of the - brain and in some pathologies, some voxels can appear where the AFD - is much higher due to T2 shine-through; it may seem appealing to use - such voxels in response function estimation as the SNR is higher, but - as for the low-signal case, the Rician noise bias will be different - to that in the rest of the brain. The previous ``dwi2response`` - binary attempted to exclude such voxels by looking at the mean and - standard deviation of AFD within the single-fibre mask, and excluding - voxels above or below a certain threshold. As before, while this - heuristic may or may not seem appropriate depending on your point of - view, it has been excluded from the new ``dwi2response`` script to - keep things as simple as possible. - -``tournier`` algorithm -^^^^^^^^^^^^^^^^^^^^^^ +'tax' algorithm +^^^^^^^^^^^^^^^ + +This algorithm is a reimplementation of the iterative approach proposed in +`Tax et al. (2014) `__ +to estimate a single b-value (single-shell) response function for +single-fibre white matter, which can subsequently be used in single-tissue +(constrained) spherical deconvolution. The algorithm iterates between +performing CSD and estimating a response function from all voxels detected +as being `single-fibre` from the CSD result itself. The criterium for +a voxel to be `single-fibre` is based on the ratio of the amplitude of +second tallest to the first tallest peak. The method is initialised with +a 'fat' response function; i.e., a response function that is safely deemed +to be much less 'sharp' than the true response function. + + + +For more information, refer to the +:ref:`tax algorithm documentation `. + +'tournier' algorithm +^^^^^^^^^^^^^^^^^^^^ Independently and in parallel, Donald also developed a newer method for response function estimation based on CSD itself; it was used in `this From be5df977ba10518e736f6a5e98d129f423bc8008 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 6 Sep 2017 22:13:26 +1000 Subject: [PATCH 137/538] Documentation updates - tck2connectome: Add references. - FAQ: Add descriptions of some common issues encountered, including: tcknormalise requiring warpcorrect to be applied beforehand; 5ttgen fsl failing at the FIRST segmentation step. --- cmd/tck2connectome.cpp | 11 +++ docs/reference/commands/tck2connectome.rst | 7 ++ docs/troubleshooting/FAQ.rst | 110 +++++++++++++++++++++ 3 files changed, 128 insertions(+) diff --git a/cmd/tck2connectome.cpp b/cmd/tck2connectome.cpp index 900137b5d6..429c4e6169 100644 --- a/cmd/tck2connectome.cpp +++ b/cmd/tck2connectome.cpp @@ -72,6 +72,17 @@ void usage () + Option ("vector", "output a vector representing connectivities from a given seed point to target nodes, " "rather than a matrix of node-node connectivities"); + REFERENCES + + "If using the default streamline-parcel assignment mechanism (or -assignment_radial_search option): " // Internal + "Smith, R. E.; Tournier, J.-D.; Calamante, F. & Connelly, A. " + "The effects of SIFT on the reproducibility and biological accuracy of the structural connectome. " + "NeuroImage, 2015, 104, 253-265" + + + "If using -scale_invlength or -scale_invnodevol options: " + "Hagmann, P.; Cammoun, L.; Gigandet, X.; Meuli, R.; Honey, C.; Wedeen, V. & Sporns, O. " + "Mapping the Structural Core of Human Cerebral Cortex. " + "PLoS Biology 6(7), e159"; + } diff --git a/docs/reference/commands/tck2connectome.rst b/docs/reference/commands/tck2connectome.rst index 07d6cc27dd..2b3587f308 100644 --- a/docs/reference/commands/tck2connectome.rst +++ b/docs/reference/commands/tck2connectome.rst @@ -85,6 +85,13 @@ Standard options - **-version** display version information and exit. +References +^^^^^^^^^^ + +If using the default streamline-parcel assignment mechanism (or -assignment_radial_search option): Smith, R. E.; Tournier, J.-D.; Calamante, F. & Connelly, A. The effects of SIFT on the reproducibility and biological accuracy of the structural connectome. NeuroImage, 2015, 104, 253-265 + +If using -scale_invlength or -scale_invnodevol options: Hagmann, P.; Cammoun, L.; Gigandet, X.; Meuli, R.; Honey, C.; Wedeen, V. & Sporns, O. Mapping the Structural Core of Human Cerebral Cortex. PLoS Biology 6(7), e159 + -------------- diff --git a/docs/troubleshooting/FAQ.rst b/docs/troubleshooting/FAQ.rst index 173c91be3a..c52e54e2f9 100644 --- a/docs/troubleshooting/FAQ.rst +++ b/docs/troubleshooting/FAQ.rst @@ -300,3 +300,113 @@ used in these figures, which I'll explain here in full. screenshot by 180 degrees: this provides a pseudo-random coloring of the termination points that contrasts well against the tracks. + +Unusual result following use of ``tcknormalise`` +------------------------------------------------ + +Sometimes, following the use of the ``tcknormalise`` command, an unusual +effect may be observed where although the bulk of the streamlines may be +aligned correctly with the target volume / space, a subset of streamlines +appear to converge very 'sharply' toward a particular point in space. + +This is caused by the presence of zero-filling in the non-linear warp +field image. In some softwares, voxels for which a proper non-linear +transformation cannot be determined between the two images will be filled +with zero values. However, ``tcknormalise`` will interpret these values as +representing an intended warp for the streamlines, such that streamline +points within those voxels will be spatially transformed to the point +[0, 0, 0] in space - this results in the convergence of many streamlines +toward the singularity point. + +The solutioin is to use the ``warpcorrect`` command, which identifies voxels +that contain the warp [0, 0, 0] and replaces them with [NaN, NaN, NaN] +("NaN" = "Not a Number"). This causes ``tcknormalise`` to _discard_ those +streamline points; consistently with the results of registration, where +appropriate non-linear transformation of these points could not be determined. + + +Encountering errors using ``5ttgen fsl`` +---------------------------------------- + +The following error messages have frequently been observed from the +``5ttgen fsl`` script: + +.. code-block:: console + + FSL FIRST has failed; not all structures were segmented successfully + Waiting for creation of new file "first-L_Accu_first.vtk" + FSL FIRST job has been submitted to SGE; awaiting completion + (note however that FIRST may fail silently, and hence this script may hang indefinitely) + +Error messages that may be found in the log files within the script's +temporary directory include: + +.. code-block:: console + + Cannot open volume first-L_Accu_corr for reading! + Image Exception : #22 :: ERROR: Could not open image first_all_none_firstseg + WARNING: NO INTERIOR VOXELS TO ESTIMATE MODE + vector::_M_range_check + terminate called after throwing an instance of 'RBD_COMMON::BaseException' + /bin/sh: line 1: 6404 Aborted /usr/local/packages/fsl-5.0.1/bin/fslmerge -t first_all_none_firstseg first-L_Accu_corr first-R_Accu_corr first-L_Caud_corr first-R_Caud_corr first-L_Pall_corr first-R_Pall_corr first-L_Puta_corr first-R_Puta_corr first-L_Thal_corr first-R_Thal_corr + +These various messages all relate to the fact that this script makes use of +FSL's FIRST tool to explicitly segment sub-cortical grey matter structures, +but this segmentation process is not successful in all circumstances. +Moreover, there are particular details with regards to the implementation of +the FIRST tool that make it awkward for the `5ttgen fsl`` script to invoke +this tool and appropriately detect whether or not the segmentation was +successful. + +It appears as though a primary source of this issue is the use of FSL's +``flirt`` tool to register the T1 image to the DWIs before running +``5ttgen fsl``. While this is consistent with the recommentation in the +:ref:`act` documentation, there is an unintended consequence of performing +this registration step specifically with the ``flirt`` tool prior to +``5ttgen fsl``. With default usage, ``flirt`` will not only _register_ the +T1 image to the DWIs, but also _resample_ the T1 to the voxel grid of the +DWIs, greatly reducing its spatial resolution. This may have a concomitant +effect during the sub-cortical segmentation by FIRST: The voxel grid is +so coarse that it is impossible to find any voxels that are entirely +encapsulated by the surface corresponding to the segmented structure, +resulting in an error within the FIRST script. + +If this is the case, it is highly recommended that the T1 image _not_ be +resampled to the DWI voxel grid following registration; not only for the +issue mentioned above, but also because ACT is explicitly designed to take +full advantage of the higher spatial resolution of the T1 image. If +``flirt`` is still to be used for registration, the solution is to instruct +``flirt`` to provide a _transformation matrix_, rather than a translated & +resampled image: + +.. code-block: console + + $ flirt -in T1.nii -ref DWI.nii -omat T12DWI_flirt.mat -dof 6 + +That transformation matrix should then applied to the T1 image in a manner +that only influences the transformation stored within the image header, and +does *not* resample the image to a new voxel grid: + +.. code-block: console + + $ transformconvert T12DWI_flirt.mat T1.nii DWI.nii flirt_import T12DWI_mrtrix.txt + $ mrtransform T1.nii T1_registered.mif -linear T12DWI_mrtrix.txt + +If the T1 image provided to ``5ttgen fsl`` has _not_ been erroneously +down-sampled, but issues are still encountered with the FIRST step, another +possible solution is to first obtain an accurate brain extraction, and then +run ``5ttgen fsl`` using the ``--premasked`` option. This results in the +registration step of FIRST being performed based on a brain-extracted +template image, which in some cases may make the process more robust. + +For any further issues, the only remaining recommendations are: + +- Investigate the temporary files that are generated within the script's + temporary directory, particularly the FIRST log files, and search for + any indication of the cause of failure. + +- Try running the FSL ``run_first_all`` script directly on your original + T1 image. If this works, then further investigation could be used to + determine precisely which images can be successfully segmented and + which cannot. If it does not, then it may be necessary to experiment + with the command-line options available in the ``run_first_all`` script. From a5caae66996d7ba0219f0d2c5c592e17ffdd8511 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 7 Sep 2017 11:58:12 +1000 Subject: [PATCH 138/538] run.command(): Indent output of failed command Hopefully this assists in visually disentangling what is printed by the script itself, and what is being echoed from the underlying failed command. --- lib/mrtrix3/run.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/mrtrix3/run.py b/lib/mrtrix3/run.py index a1ccdef775..930fff7c22 100644 --- a/lib/mrtrix3/run.py +++ b/lib/mrtrix3/run.py @@ -186,7 +186,8 @@ def command(cmd, exitOnError=True): app.console('') sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + app.colourError + '[ERROR] Command failed: ' + cmd + app.colourClear + app.colourDebug + ' (' + os.path.basename(caller.filename) + ':' + str(caller.lineno) + ')' + app.colourClear + '\n') sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + app.colourConsole + 'Output of failed command:' + app.colourClear + '\n') - sys.stderr.write(error_text) + for line in error_text.splitlines(): + sys.stderr.write(' ' + line + '\n') sys.stderr.flush() if app._tempDir: with open(os.path.join(app._tempDir, 'error.txt'), 'w') as outfile: From 45c7cbbf5b68436cd4ce4c1e5e638c62937464fe Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 7 Sep 2017 12:08:36 +1000 Subject: [PATCH 139/538] 5ttgen fsl: Additional options to run_first_all - If script is run with -nocleanup option, instruct run_first_all to not clean up its own temporary files, for the sake of debugging. - If script is run with -debug option, instruct run_first_all to operate in verbose mode. --- lib/mrtrix3/_5ttgen/fsl.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/mrtrix3/_5ttgen/fsl.py b/lib/mrtrix3/_5ttgen/fsl.py index eeaba1da7c..fc47962045 100644 --- a/lib/mrtrix3/_5ttgen/fsl.py +++ b/lib/mrtrix3/_5ttgen/fsl.py @@ -174,7 +174,13 @@ def execute(): first_input_brain_extracted_option = '' if app.args.premasked: first_input_brain_extracted_option = ' -b' - run.command(first_cmd + ' -m none -s ' + ','.join(sgm_structures) + ' -i ' + first_input + ' -o first' + first_input_brain_extracted_option) + first_debug_option = '' + if not app._cleanup: + first_debug_option = ' -d' + first_verbosity_option = '' + if app._verbosity == 3: + first_verbosity_option = ' -v' + run.command(first_cmd + ' -m none -s ' + ','.join(sgm_structures) + ' -i ' + first_input + ' -o first' + first_input_brain_extracted_option + first_debug_option + first_verbosity_option) # Test to see whether or not FIRST has succeeded # However if the expected image is absent, it may be due to FIRST being run @@ -189,8 +195,7 @@ def execute(): else: combined_image_path = fsl.findImage('first_all_none_firstseg') if not os.path.isfile(combined_image_path): - app.error('FSL FIRST has failed; not all structures were segmented successfully (check ' + -path.toTemp('first.logs', False) + ')') + app.error('FSL FIRST has failed; not all structures were segmented successfully (check ' + path.toTemp('first.logs', False) + ')') # Convert FIRST meshes to partial volume images pve_image_list = [ ] From 6d8baa02c11e4131ea408ff424979177d3379fae Mon Sep 17 00:00:00 2001 From: Rami Tabbara Date: Thu, 7 Sep 2017 16:03:44 +1000 Subject: [PATCH 140/538] mrview: tract_geom: Correctly updating VAO when downsampling * Offset issues plus set max_stride = track_padding / 2 * The problem is that each call to vertex shader packs prev, curr, next vertex => For a given track, first call to VS must contain: track_start, track_start, next_ver Similarly, for the final call we must have: second_last_vertex, track_end, track_end * The only way to guarantee the above is to ensure max downsampling factor is strictly <= track_padding / 2 --- .../mrview/tool/tractography/tractogram.cpp | 54 ++++++++++++------- src/gui/mrview/tool/tractography/tractogram.h | 2 +- 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/src/gui/mrview/tool/tractography/tractogram.cpp b/src/gui/mrview/tool/tractography/tractogram.cpp index 7104530ab2..4492279280 100644 --- a/src/gui/mrview/tool/tractography/tractogram.cpp +++ b/src/gui/mrview/tool/tractography/tractogram.cpp @@ -34,7 +34,7 @@ namespace MR { namespace Tool { - const int Tractogram::max_sample_stride; + const int Tractogram::track_padding; TrackGeometryType Tractogram::default_tract_geom (TrackGeometryType::Pseudotubes); std::string Tractogram::Shader::vertex_shader_source (const Displayable& displayable) @@ -544,15 +544,26 @@ namespace MR gl::VertexAttribPointer (2, 3, gl::FLOAT, gl::FALSE_, 3*sample_stride*sizeof(float), (void*)(6*sample_stride*sizeof(float))); for(size_t j = 0, M = track_sizes[buf].size(); j < M; ++j) { - track_sizes[buf][j] = (GLint) std::floor (original_track_sizes[buf][j] / (float)sample_stride); - track_starts[buf][j] = (GLint) (std::ceil (original_track_starts[buf][j] / (float)sample_stride)) - 1; + track_sizes[buf][j] = (GLint) std::ceil (original_track_sizes[buf][j] / (float)sample_stride); + track_starts[buf][j] = (GLint) std::floor (original_track_starts[buf][j] / (float)sample_stride); + + // Vertex attributes are packed prev, curr, next + // So ensure first curr does indeed correspond to track start + if (original_track_starts[buf][j] - sample_stride * track_starts[buf][j] < sample_stride - 1) + --track_starts[buf][j]; + + // Ensure final vertex corresponds to track end + GLint offset = original_track_starts[buf][j] + original_track_sizes[buf][j] + - (track_starts[buf][j] + track_sizes[buf][j] - 1) * sample_stride; + + track_sizes[buf][j] += (GLint)std::floor(offset / (float)sample_stride); } } - if (geometry_type == TrackGeometryType::Points) - gl::MultiDrawArrays (gl::POINTS, &track_starts[buf][0], &track_sizes[buf][0], num_tracks_per_buffer[buf]); - else - gl::MultiDrawArrays (gl::LINE_STRIP, &track_starts[buf][0], &track_sizes[buf][0], num_tracks_per_buffer[buf]); + auto mode = geometry_type == TrackGeometryType::Points ? gl::POINTS : gl::LINE_STRIP; + + gl::MultiDrawArrays (mode, &track_starts[buf][0], &track_sizes[buf][0], num_tracks_per_buffer[buf]); + } vao_dirty = false; @@ -571,7 +582,10 @@ namespace MR const auto geom_size = geometry_type == TrackGeometryType::Pseudotubes ? Tractogram::default_line_thickness : Tractogram::default_point_size; new_stride = GLint (geom_size * std::exp (2.0e-3f * line_thickness) * original_fov / step_size); - new_stride = std::max (1, std::min (max_sample_stride, new_stride)); + // We have to ensure that our vertex buffer contains at least two copies + // of track start and track end to correctly render our tracks + // => Max stride = track_padding / 2 + new_stride = std::max (1, std::min (track_padding / 2, new_stride)); } if (new_stride != sample_stride) { @@ -608,17 +622,17 @@ namespace MR // Pre padding // To support downsampling, we want to ensure that the starting track vertex // is used even when we're using a stride > 1 - for (size_t i = 0; i < max_sample_stride; ++i) + for (size_t i = 0; i < track_padding; ++i) buffer.push_back (tck.front()); - starts.push_back (buffer.size()); + starts.push_back (buffer.size() - 1); buffer.insert (buffer.end(), tck.begin(), tck.end()); // Post padding // Similarly, to support downsampling, we also want to ensure the final track vertex // will be used even we're using a stride > 1 - for (size_t i = 0; i < max_sample_stride; ++i) + for (size_t i = 0; i < track_padding; ++i) buffer.push_back(tck.back()); sizes.push_back (N); @@ -662,7 +676,7 @@ namespace MR const size_t tck_length = original_track_sizes[buffer_index][buffer_tck_counter]; // Includes pre- and post-padding to coincide with tracks buffer - for (size_t i = 0; i != tck_length + (2 * max_sample_stride); ++i) + for (size_t i = 0; i != tck_length + (2 * track_padding); ++i) buffer.push_back (colour); } @@ -702,7 +716,7 @@ namespace MR continue; // Pre padding to coincide with tracks buffer - for (size_t i = 0; i < max_sample_stride; ++i) + for (size_t i = 0; i < track_padding; ++i) buffer.push_back (tck_scalar.front()); for (size_t i = 0; i < tck_size; ++i) { @@ -712,7 +726,7 @@ namespace MR } // Post padding to coincide with tracks buffer - for (size_t i = 0; i < max_sample_stride; ++i) + for (size_t i = 0; i < track_padding; ++i) buffer.push_back (tck_scalar.back()); if (buffer.size() >= MAX_BUFFER_SIZE) @@ -739,13 +753,13 @@ namespace MR tck_scalar.assign (track_lengths[index], value); // Pre padding to coincide with tracks buffer - for (size_t i = 0; i < max_sample_stride; ++i) + for (size_t i = 0; i < track_padding; ++i) buffer.push_back (tck_scalar.front()); buffer.insert (buffer.end(), tck_scalar.begin(), tck_scalar.end()); // Post padding to coincide with tracks buffer - for (size_t i = 0; i < max_sample_stride; ++i) + for (size_t i = 0; i < track_padding; ++i) buffer.push_back (tck_scalar.back()); value_max = std::max (value_max, value); @@ -791,7 +805,7 @@ namespace MR continue; // Pre padding to coincide with tracks buffer - for (size_t i = 0; i < max_sample_stride; ++i) + for (size_t i = 0; i < track_padding; ++i) buffer.push_back (tck_scalar.front()); for (size_t i = 0; i < tck_size; ++i) { @@ -801,7 +815,7 @@ namespace MR } // Post padding to coincide with tracks buffer - for (size_t i = 0; i < max_sample_stride; ++i) + for (size_t i = 0; i < track_padding; ++i) buffer.push_back (tck_scalar.back()); if (buffer.size() >= MAX_BUFFER_SIZE) @@ -828,13 +842,13 @@ namespace MR tck_scalar.assign (track_lengths[index], value); // Pre padding to coincide with tracks buffer - for (size_t i = 0; i < max_sample_stride; ++i) + for (size_t i = 0; i < track_padding; ++i) buffer.push_back (tck_scalar.front()); buffer.insert (buffer.end(), tck_scalar.begin(), tck_scalar.end()); // Post padding to coincide with tracks buffer - for (size_t i = 0; i < max_sample_stride; ++i) + for (size_t i = 0; i < track_padding; ++i) buffer.push_back (tck_scalar.back()); threshold_max = std::max (threshold_max, value); diff --git a/src/gui/mrview/tool/tractography/tractogram.h b/src/gui/mrview/tool/tractography/tractogram.h index 6644915e1a..6050bc389d 100644 --- a/src/gui/mrview/tool/tractography/tractogram.h +++ b/src/gui/mrview/tool/tractography/tractogram.h @@ -121,7 +121,7 @@ namespace MR void scalingChanged (); private: - static const int max_sample_stride = 6; + static const int track_padding = 6; Tractography& tractography_tool; const std::string filename; From 68962f0f0f6afee496451f3a3593784a5beb18f2 Mon Sep 17 00:00:00 2001 From: Max Pietsch Date: Thu, 7 Sep 2017 09:21:33 +0100 Subject: [PATCH 141/538] mrview added glarea->update() to mouseMoveEventGL to fix not updating after pan using pan mode (not gesture) --- src/gui/mrview/window.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/mrview/window.cpp b/src/gui/mrview/window.cpp index 05f89420f2..269ba92fc9 100644 --- a/src/gui/mrview/window.cpp +++ b/src/gui/mrview/window.cpp @@ -1635,6 +1635,7 @@ namespace MR default: return; } event->accept(); + glarea->update(); } From 04edda5bba6012a3a9edbbc4711751dda1d055c9 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Fri, 8 Sep 2017 14:57:49 +1000 Subject: [PATCH 142/538] ongoing docs --- .../response_function_estimation.rst | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/docs/constrained_spherical_deconvolution/response_function_estimation.rst b/docs/constrained_spherical_deconvolution/response_function_estimation.rst index b596d04769..00a69ded39 100644 --- a/docs/constrained_spherical_deconvolution/response_function_estimation.rst +++ b/docs/constrained_spherical_deconvolution/response_function_estimation.rst @@ -20,9 +20,9 @@ although some have proven to be more widely applicable than others. Quick advice ------------ -These algorithms appear to perform well in a wide range of scenarios, -based on experience and testing from both developers and the -`MRtrix3 community `__.: +The following algorithms appear to perform well in a wide range of +scenarios, based on experience and testing from both developers and +the `MRtrix3 community `__: - If you intend to perform *single-tissue* spherical deconvolution, the ``tournier`` algorithm is a convenient and reliable way to @@ -108,6 +108,9 @@ The following sections provide more details on each algorithm specifically. TODO: Thijs is working on this documentation section. +For more information, refer to the +:ref:`dhollander algorithm documentation `. + 'fa' algorithm ^^^^^^^^^^^^^^ @@ -141,6 +144,9 @@ manual definition of both the single-fibre voxel mask (or just a voxel mask for isotropic tissues); the fibre directions can also be provided manually if necessary (otherwise a tensor fit will be used). +For more information, refer to the +:ref:`manual algorithm documentation `. + 'msmt_5tt' algorithm ^^^^^^^^^^^^^^^^^^^^ @@ -181,6 +187,9 @@ For reference, this algorithm operates as follows: 4. Derive a multi-shell response for each tissue for each of these three tissues. For GM and CSF, use *lmax=0* for all shells. +For more information, refer to the +:ref:`msmt_5tt algorithm documentation `. + 'tax' algorithm ^^^^^^^^^^^^^^^ @@ -196,8 +205,6 @@ second tallest to the first tallest peak. The method is initialised with a 'fat' response function; i.e., a response function that is safely deemed to be much less 'sharp' than the true response function. - - For more information, refer to the :ref:`tax algorithm documentation `. @@ -241,6 +248,9 @@ processing of non-human brain images in particular, you may need to experiment with the number of single-fibre voxels as the white matter is typically smaller. +For more information, refer to the +:ref:`tournier algorithm documentation `. + Writing your own algorithms --------------------------- From 388472d49d3110e6977999e7cf25236c3bcc77f5 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Mon, 11 Sep 2017 12:50:51 +1000 Subject: [PATCH 143/538] ongoing docs --- .../response_function_estimation.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/constrained_spherical_deconvolution/response_function_estimation.rst b/docs/constrained_spherical_deconvolution/response_function_estimation.rst index 00a69ded39..1528257caf 100644 --- a/docs/constrained_spherical_deconvolution/response_function_estimation.rst +++ b/docs/constrained_spherical_deconvolution/response_function_estimation.rst @@ -203,7 +203,14 @@ as being `single-fibre` from the CSD result itself. The criterium for a voxel to be `single-fibre` is based on the ratio of the amplitude of second tallest to the first tallest peak. The method is initialised with a 'fat' response function; i.e., a response function that is safely deemed -to be much less 'sharp' than the true response function. +to be much less 'sharp' than the true response function. + +This algorithm has occasionally been found to behave unstable and converge +towards suboptimal solutions. The ``tournier`` algorithm has been engineered +to overcome some of the issues believed to be the cause of these +instabilities (see some discussion on this topic +`here `__ +and `here `__). For more information, refer to the :ref:`tax algorithm documentation `. From 1c86d5166be00020a55ad37b4de647e3a657c09d Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 11 Sep 2017 15:09:33 +1000 Subject: [PATCH 144/538] Scripts: Various tweaks - 5ttgen fsl: Relax threshold for issuing warning about T1 resolution and re-sampling for FIRST. - Alter handling of keyboard and system interrupts during run.command(); these shoould be caught by the handler rather than explicitly invoking the handler. - Don't issue "Changing back to working directory" message if script exited before the working directory even moved. - Alter indenting when output of a failed command is printed, to improve alignment & segmentation of this text from the primary script feedback. - Explicitly catch errors that occur with a run.function() call, and perform similar cleanup / feedback to that of the run.command() function. --- lib/mrtrix3/_5ttgen/fsl.py | 7 ++++--- lib/mrtrix3/app.py | 5 +++-- lib/mrtrix3/run.py | 36 +++++++++++++++++++++++++++++------- 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/lib/mrtrix3/_5ttgen/fsl.py b/lib/mrtrix3/_5ttgen/fsl.py index 27027e5cc5..caaf8f484b 100644 --- a/lib/mrtrix3/_5ttgen/fsl.py +++ b/lib/mrtrix3/_5ttgen/fsl.py @@ -34,7 +34,7 @@ def getInputs(): #pylint: disable=unused-variable def execute(): #pylint: disable=unused-variable - import os + import math, os from mrtrix3 import app, file, fsl, image, path, run #pylint: disable=redefined-builtin if app.isWindows(): @@ -61,8 +61,9 @@ def execute(): #pylint: disable=unused-variable t1_spacing = image.Header('input.mif').spacing() upsample_for_first = False - if max(t1_spacing) > 1.025: #Allow e.g. 1.01mm voxels, if FoV and matrix size are not perfectly equivalent - app.warn('Voxel size larger than 1.0mm detected (' + str(t1_spacing) + '); ' + # If voxel size is 1.25mm or larger, make a guess that the user has erroneously re-gridded their data + if math.pow(t1_spacing[0] * t1_spacing[1] * t1_spacing[2], 1.0/3.0) > 1.225: + app.warn('Voxel size larger than expected for T1-weighted images (' + str(t1_spacing) + '); ' 'note that ACT does not require re-gridding of T1 image to DWI space, and indeed ' 'retaining the original higher resolution of the T1 image is preferable') upsample_for_first = True diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index d759136837..c4be38a852 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -252,8 +252,9 @@ def complete(): #pylint: disable=unused-variable import os, shutil, sys global cleanup, tempDir, workingDir global colourClear, colourConsole, colourWarn - console('Changing back to original directory (' + workingDir + ')') - os.chdir(workingDir) + if os.getcwd() != workingDir: + console('Changing back to original directory (' + workingDir + ')') + os.chdir(workingDir) if cleanup and tempDir: console('Deleting temporary directory ' + tempDir) shutil.rmtree(tempDir) diff --git a/lib/mrtrix3/run.py b/lib/mrtrix3/run.py index d8ab07394b..2712c36755 100644 --- a/lib/mrtrix3/run.py +++ b/lib/mrtrix3/run.py @@ -146,7 +146,7 @@ def command(cmd, exitOnError=True): #pylint: disable=unused-variable process.wait() except (KeyboardInterrupt, SystemExit): - app.handler(signal.SIGINT, inspect.currentframe()) + raise # For any command stdout / stderr data that wasn't either passed to another command or # printed to the terminal during execution, read it here. @@ -174,11 +174,13 @@ def command(cmd, exitOnError=True): #pylint: disable=unused-variable app.cleanup = False if exitOnError: caller = inspect.getframeinfo(inspect.stack()[1][0]) + script_name = os.path.basename(sys.argv[0]) app.console('') - sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + app.colourError + '[ERROR] Command failed: ' + cmd + app.colourClear + app.colourDebug + ' (' + os.path.basename(caller.filename) + ':' + str(caller.lineno) + ')' + app.colourClear + '\n') - sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + app.colourConsole + 'Output of failed command:' + app.colourClear + '\n') + sys.stderr.write(script_name + ': ' + app.colourError + '[ERROR] Command failed: ' + cmd + app.colourClear + app.colourDebug + ' (' + os.path.basename(caller.filename) + ':' + str(caller.lineno) + ')' + app.colourClear + '\n') + sys.stderr.write(script_name + ': ' + app.colourConsole + 'Output of failed command:' + app.colourClear + '\n') for line in error_text.splitlines(): - sys.stderr.write(' ' + line + '\n') + sys.stderr.write(' ' * (len(script_name)+2) + line + '\n') + app.console('') sys.stderr.flush() if app.tempDir: with open(os.path.join(app.tempDir, 'error.txt'), 'w') as outfile: @@ -203,10 +205,10 @@ def command(cmd, exitOnError=True): #pylint: disable=unused-variable def function(fn, *args): #pylint: disable=unused-variable - import sys + import inspect, sys from mrtrix3 import app - fnstring = fn.__module__ + '.' + fn.__name__ + '(' + ', '.join(args) + ')' + fnstring = fn.__module__ + '.' + fn.__name__ + '(' + ', '.join(['\'' + str(a) + '\'' if isinstance(a, str) else str(a) for a in args]) + ')' if _lastFile: if _triggerContinue(args): @@ -221,7 +223,27 @@ def function(fn, *args): #pylint: disable=unused-variable sys.stderr.flush() # Now we need to actually execute the requested function - result = fn(*args) + try: + result = fn(*args) + except (KeyboardInterrupt, SystemExit): + raise + except Exception as e: # pylint: disable=broad-except + app.cleanup = False + caller = inspect.getframeinfo(inspect.stack()[1][0]) + error_text = str(type(e).__name__) + ': ' + str(e) + script_name = os.path.basename(sys.argv[0]) + app.console('') + sys.stderr.write(script_name + ': ' + app.colourError + '[ERROR] Function failed: ' + fnstring + app.colourClear + app.colourDebug + ' (' + os.path.basename(caller.filename) + ':' + str(caller.lineno) + ')' + app.colourClear + '\n') + sys.stderr.write(script_name + ': ' + app.colourConsole + 'Information from failed function:' + app.colourClear + '\n') + for line in error_text.splitlines(): + sys.stderr.write(' ' * (len(script_name)+2) + line + '\n') + app.console('') + sys.stderr.flush() + if app.tempDir: + with open(os.path.join(app.tempDir, 'error.txt'), 'w') as outfile: + outfile.write(fnstring + '\n\n' + error_text + '\n') + app.complete() + sys.exit(1) # Only now do we append to the script log, since the function has completed successfully if app.tempDir: From 6cfc7560fcbe4d84bad9b8e4c57a0addbdee51c5 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Mon, 11 Sep 2017 15:53:03 +1000 Subject: [PATCH 145/538] ongoing docs; 'tournier' algorithm intricacies: differences with respect to the Tournier et al. 2013 publication, differences with respect to 'tax' algorithm --- .../response_function_estimation.rst | 92 ++++++++++--------- 1 file changed, 50 insertions(+), 42 deletions(-) diff --git a/docs/constrained_spherical_deconvolution/response_function_estimation.rst b/docs/constrained_spherical_deconvolution/response_function_estimation.rst index 1528257caf..5ef0d28c7c 100644 --- a/docs/constrained_spherical_deconvolution/response_function_estimation.rst +++ b/docs/constrained_spherical_deconvolution/response_function_estimation.rst @@ -116,8 +116,8 @@ For more information, refer to the This algorithm is an implementation of the strategy proposed in `Tournier et al. (2004) `__ -to estimate a single b-value (single-shell) response function for -single-fibre white matter, which can subsequently be used in single-tissue +to estimate a single b-value (single-shell) response function of +single-fibre white matter, which can subsequently be used for single-tissue (constrained) spherical deconvolution. The algorithm estimates this response function from the 300 voxels with the highest FA value in an eroded brain mask. There are also options to change this number or @@ -195,12 +195,12 @@ For more information, refer to the This algorithm is a reimplementation of the iterative approach proposed in `Tax et al. (2014) `__ -to estimate a single b-value (single-shell) response function for -single-fibre white matter, which can subsequently be used in single-tissue +to estimate a single b-value (single-shell) response function of +single-fibre white matter, which can subsequently be used for single-tissue (constrained) spherical deconvolution. The algorithm iterates between performing CSD and estimating a response function from all voxels detected -as being `single-fibre` from the CSD result itself. The criterium for -a voxel to be `single-fibre` is based on the ratio of the amplitude of +as being 'single-fibre' from the CSD result itself. The criterium for +a voxel to be 'single-fibre' is based on the ratio of the amplitude of second tallest to the first tallest peak. The method is initialised with a 'fat' response function; i.e., a response function that is safely deemed to be much less 'sharp' than the true response function. @@ -218,42 +218,50 @@ For more information, refer to the 'tournier' algorithm ^^^^^^^^^^^^^^^^^^^^ -Independently and in parallel, Donald also developed a newer method for -response function estimation based on CSD itself; it was used in `this -manuscript `__. It bears some -resemblance to the ``tax`` algorithm, but relies on a threshold on the -number of voxels in the single-fibre mask, rather than the ratio between -tallest and second-tallest peaks. The operation is as follows: - -1. Define an initial response function that is as sharp as possible - (ideally a flat disk, but will be fatter due to spherical harmonic - truncation). Limit this initial function to *lmax=4*, as this makes - the FODs less noisy in the first iteration. - -2. Run CSD for all voxels within the mask (initially, this is the whole - brain). - -3. Select the 300 'best' single-fibre voxels. This is not precisely the - ratio between tallest and second-tallest peaks; instead, the - following equation is used, which also biases toward selection of - voxels where the tallest FOD peak is larger: - ``sqrt(|peak1|) * (1 - |peak2| / |peak1|)^2``. Use these voxels to - generate a new response fuction. - -4. Test to see if the selection of single-fibre voxels has changed; if - not, the script is completed. - -5. Derive a mask of voxels to test in the next iteration. This is the - top 3,000 voxels according to the equation above, and dilated by one - voxel. - -6. Go back to step 2. - -This approach appears to be giving reasonable results for the datasets -on which it has been tested. However if you are involved in the -processing of non-human brain images in particular, you may need to -experiment with the number of single-fibre voxels as the white matter is -typically smaller. +This algorithm is an implementation of the iterative approach proposed in +`Tournier et al. (2013) `__ +to estimate a single b-value (single-shell) response function of +single-fibre white matter, which can subsequently be used for single-tissue +(constrained) spherical deconvolution. The algorithm iterates between +performing CSD and estimating a response function from a set of the best +'single-fibre' voxels as detected from the CSD result itself. Notable differences +between this implementation and the algorithm described in `Tournier et al. (2013) +`__ include: + +- This implementation is initialised by a sharp lmax=4 response function + as opposed to one estimated from the 300 brain voxels with the highest FA. + +- This implementation uses a more complex metric to measure how + 'single-fibre' FODs are: ``sqrt(|peak1|) * (1 - |peak2| / |peak1|)^2``, + as opposed to a simple ratio of the tallest peaks. This new metric has + a bias towards FODs with a larger tallest peak, to avoid favouring + small, yet low SNR, FODs. + +- This implementation only performs CSD on the 3000 best 'single-fibre' + voxels (of the previous iteration) at each iteration. + +While the ``tournier`` algorithm has a similar iterative structure as the +``tax`` algorithm, it was designed to overcome some occasional instabilities +and suboptimal solutions resulting from the latter. Notable differences +between the ``tournier`` and ``tax`` algorithms include: + +- The ``tournier`` algorithm is initialised by a *sharp* (lmax=4) response + function, while the ``tax`` algorithm is initialised by a *fat* response + function. + +- This implementation of the ``tournier`` algorithm uses a more complex + metric to measure how 'single-fibre' FODs are (see above), while the + ``tax`` algorithm uses a simple ratio of the tallest peaks. + +- The ``tournier`` algorithm estimates the response function at each + iteration only from the 300 *best* 'single-fibre' voxels, while the + ``tax`` algorithm uses *all* 'single-fibre' voxels. + +Due to these differences, ``tournier`` algorithm is currently believed to +be more robust and accurate in a wider range of scenarios (for further +information on this topic, refer to some of the discussions +`here `__ +and `here `__). For more information, refer to the :ref:`tournier algorithm documentation `. From 187841a7acad029caf6e943e3a6f6fab134915e3 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 12 Sep 2017 11:14:22 +1000 Subject: [PATCH 146/538] Scripts: Further tweaks - Disable ANSI control codes when stderr is not a TTY. - Incorporate progress bar into some scripts where appropriate. - Make app.progressBar compatible with both non-TTY outputs, and in the absence of a priori knowledge of the number of increments, in a manner similar to the MRtrix3 binaries. --- bin/dwigradcheck | 7 ++++ bin/dwiintensitynorm | 12 +++++-- bin/labelsgmfix | 6 ++++ bin/population_template | 41 ++++++++++++++++++++--- lib/mrtrix3/app.py | 73 ++++++++++++++++++++++++++++++++++------- lib/mrtrix3/run.py | 46 +++++++++++--------------- 6 files changed, 140 insertions(+), 45 deletions(-) diff --git a/bin/dwigradcheck b/bin/dwigradcheck index 7204f18c6e..4df359c114 100755 --- a/bin/dwigradcheck +++ b/bin/dwigradcheck @@ -115,11 +115,14 @@ number_option = ' -select ' + str(app.args.number) axis_flips = [ 'none', 0, 1, 2 ] axis_permutations = [ ( 0, 1, 2 ), (0, 2, 1), (1, 0, 2), (1, 2, 0), (2, 0, 1), (2, 1, 0) ] grad_basis = [ 'scanner', 'image' ] +total_tests = len(axis_flips) * len(axis_permutations) * len(grad_basis) # List where the first element is the mean length lengths = [ ] +progress = app.progressBar('Testing gradient table alterations (0 of ' + str(total_tests) + ')', total_tests) + for flip in axis_flips: for permutation in axis_permutations: for basis in grad_basis: @@ -171,6 +174,10 @@ for flip in axis_flips: # Add to the database lengths.append([meanlength,flip,permutation,basis]) + # Increament the progress bar + progress.increment('Testing gradient table alterations (' + str(len(lengths)) + ' of ' + str(total_tests) + ')') + +progress.done() # Sort the list to find the best gradient configuration(s) lengths.sort() diff --git a/bin/dwiintensitynorm b/bin/dwiintensitynorm index 777efad61a..a6e3a18838 100755 --- a/bin/dwiintensitynorm +++ b/bin/dwiintensitynorm @@ -81,24 +81,32 @@ file.makeDir(app.args.output_dir) app.makeTempDir() maskTempDir = os.path.join(app.tempDir, os.path.basename(os.path.normpath(maskDir))) -run.command ('cp -R -L ' + maskDir + ' ' + maskTempDir) +run.command('cp -R -L ' + maskDir + ' ' + maskTempDir) app.gotoTempDir() file.makeDir('fa') -app.console('Computing FA images') +progress = app.progressBar('Computing FA images', len(input_list)) for i in input_list: run.command('dwi2tensor ' + abspath(i.directory, i.filename) + ' -mask ' + abspath(i.mask_directory, i.mask_filename) + ' - | tensor2metric - -fa ' + os.path.join('fa', i.prefix + '.mif')) + progress.increment() +progress.done() app.console('Generating FA population template') run.command('population_template fa -mask_dir ' + maskTempDir + ' fa_template.mif -type rigid_affine_nonlinear -rigid_scale 0.25,0.5,0.8,1.0 -affine_scale 0.7,0.8,1.0,1.0 -nl_scale 0.5,0.75,1.0,1.0,1.0 -nl_niter 5,5,5,5,5 -tempdir population_template -linear_no_pause -nocleanup') +app.console('Generating WM mask in template space') run.command('mrthreshold fa_template.mif -abs ' + app.args.fa_threshold + ' template_wm_mask.mif') + +progress = app.progressBar('Intensity normalising subject images', len(input_list)) file.makeDir('wm_mask_warped') for i in input_list: run.command('mrtransform template_wm_mask.mif -interp nearest -warp_full ' + os.path.join('population_template', 'warps', i.prefix + '.mif') + ' ' + os.path.join('wm_mask_warped', i.prefix + '.mif') + ' -from 2 -template ' + os.path.join('fa', i.prefix + '.mif')) run.command('dwinormalise ' + abspath(i.directory, i.filename) + ' ' + os.path.join('wm_mask_warped', i.prefix + '.mif') + ' ' + path.fromUser(os.path.join(app.args.output_dir, i.filename), True) + (' -force' if app.forceOverwrite else '')) + progress.increment() +progress.done() +app.console('Exporting template images to user locations') run.command('mrconvert template_wm_mask.mif ' + path.fromUser(app.args.wm_mask, True) + (' -force' if app.forceOverwrite else '')) run.command('mrconvert fa_template.mif ' + path.fromUser(app.args.fa_template, True) + (' -force' if app.forceOverwrite else '')) diff --git a/bin/labelsgmfix b/bin/labelsgmfix index aeb5b96d11..8860b4d727 100755 --- a/bin/labelsgmfix +++ b/bin/labelsgmfix @@ -103,6 +103,7 @@ with open(sgm_lut_file_path) as f: # Convert FIRST meshes to node masks # In this use case, don't want the PVE images; want to threshold at 0.5 mask_list = [ ] +progress = app.progressBar('Generating mask images for SGM structures', len(structure_map)) for key, value in structure_map.items(): image_path = key + '_mask.mif' mask_list.append(image_path) @@ -115,6 +116,8 @@ for key, value in structure_map.items(): if not app.continueOption: run.function(os.remove, 'sgm.mif') run.function(os.rename, 'sgm_new.mif', 'sgm.mif') + progress.increment() +progress.done() # Detect any overlapping voxels between the SGM masks, and set to zero run.command('mrmath ' + ' '.join(mask_list) + ' sum - | mrcalc - 1 -gt sgm_overlap_mask.mif') @@ -127,12 +130,15 @@ run.command('labelconvert sgm_masked.mif ' + sgm_lut_file_path + ' ' + path.from # * Figure out what index the structure has been mapped to; this can only be done using mrstats # * Strip that index from the parcellation image # * Insert the new delineation of that structure +progress = app.progressBar('Replacing SGM parcellations', len(structure_map)) for struct in structure_map: image_path = struct + '_mask.mif' index = image.statistic('sgm_new_labels.mif', 'median', '-mask ' + image_path) run.command('mrcalc parc.mif ' + index + ' -eq 0 parc.mif -if parc_removed.mif') run.function(os.remove, 'parc.mif') run.function(os.rename, 'parc_removed.mif', 'parc.mif') + progress.increment() +progress.done() # Insert the new delineations of all SGM structures in a single call # Enforce unsigned integer datatype of output image diff --git a/bin/population_template b/bin/population_template index 12d5d2ad3b..61e6614afe 100755 --- a/bin/population_template +++ b/bin/population_template @@ -450,28 +450,39 @@ else: # crop average space to extent defined by original masks if useMasks: + progress = app.progressBar('Importing input masks to average space for template cropping', len(inputs)) mask_filenames = [] for i in inputs: run.command('mrtransform ' + abspath(i.mask_directory, i.mask_filename) + \ ' -interp nearest -template average_header.mif ' + os.path.join('masks_transformed', i.mask_filename)) mask_filenames.append(os.path.join('masks_transformed', i.mask_filename)) + progress.increment() + progress.done() run.command('mrmath ' + ' '.join(mask_filenames) + ' max mask_initial.mif' ) run.command('mrcrop ' + 'average_header.mif -mask mask_initial.mif average_header_cropped.mif') run.function(remove,'mask_initial.mif') run.function(remove, 'average_header.mif') run.function(move, 'average_header_cropped.mif', 'average_header.mif') + progress = app.progressBar('Erasing temporary mask images', len(mask_filenames)) for mask in mask_filenames: run.function(remove, mask) + progress.increment() + progress.done() + if initial_alignment == 'none': + progress = app.progressBar('Resampling input images to template space with no initial alignment', len(inputs)) for i in inputs: run.command('mrtransform ' + abspath(i.directory, i.filename) + ' -interp linear -template average_header.mif ' + os.path.join('inputs_transformed', i.prefix + '.mif') + datatype) + progress.increment() + progress.done() if not dolinear: for i in inputs: with open(os.path.join('linear_transforms_initial','%s.txt' % (i.prefix)),'w') as fout: fout.write('1 0 0 0\n0 1 0 0\n0 0 1 0\n0 0 0 1\n') else: + progress = app.progressBar('Performing initial rigid registration to template', len(inputs)) mask = '' for i in inputs: if useMasks: @@ -496,6 +507,8 @@ else: ' -linear ' + os.path.join('linear_transforms_initial', i.prefix + '.txt') + \ datatype + ' ' + \ os.path.join('masks_transformed', i.prefix + '_translated.mif')) + progress.increment() + progress.done() # update average space to new extent run.command('mraverageheader ' + ' '.join([os.path.join('inputs_transformed', i.prefix + '_translated.mif') for i in inputs]) + ' average_header_tight.mif') if voxel_size is None: @@ -505,12 +518,15 @@ else: run.function(remove, 'average_header_tight.mif') if useMasks: # reslice masks + progress = app.progressBar('Reslicing input masks to average header', len(inputs)) for i in inputs: run.command('mrtransform ' + \ os.path.join('masks_transformed', i.prefix + '_translated.mif') + ' ' + \ os.path.join('masks_transformed', i.prefix + '.mif') + ' ' + \ '-interp nearest -template average_header.mif' + \ datatype) + progress.increment() + progress.done() # crop average space to extent defined by translated masks mask_filenames = [] for i in inputs: @@ -520,6 +536,7 @@ else: # pad average space to allow for deviation from initial alignment run.command('mrpad -uniform 10 average_header_cropped.mif -force average_header.mif') run.function(remove, 'average_header_cropped.mif') + progress = app.progressBar('Reslicing mask images to new padded average header', len(inputs)) for i in inputs: run.command('mrtransform ' + os.path.join('masks_transformed', i.prefix + '_translated.mif') + ' ' + \ @@ -528,8 +545,11 @@ else: datatype + ' ' + \ '-force') run.function(remove, os.path.join('masks_transformed', i.prefix + '_translated.mif')) + progress.increment() + progress.done() run.function(remove, 'mask_translated.mif') # reslice input images + progress = app.progressBar('Reslicing input images to average header', len(inputs)) for i in inputs: run.command('mrtransform ' + \ os.path.join('inputs_transformed', i.prefix + '_translated.mif') + ' ' + \ @@ -537,6 +557,8 @@ else: '-interp linear -template average_header.mif' + \ datatype) run.function(remove, os.path.join('inputs_transformed', i.prefix + '_translated.mif')) + progress.increment() + progress.done() run.command('mrmath ' + allindir('inputs_transformed') + ' mean initial_template.mif') @@ -548,9 +570,9 @@ if not dolinear: for i in inputs: run.function(copy, os.path.join('linear_transforms_initial','%s.txt' % (i.prefix)), os.path.join('linear_transforms','%s.txt' % (i.prefix))) else: - app.console('Optimising template with linear registration') for level in range(0, len(linear_scales)): - for i in inputs: + progress = app.progressBar('Optimising template with linear registration (stage {0} of {1}, 0 of {2} subjects)'.format(level+1, len(linear_scales), len(inputs)), len(inputs)) + for counter, i in enumerate(inputs): initialise = '' if useMasks: mask = ' -mask1 ' + abspath(i.mask_directory, i.mask_filename) @@ -604,6 +626,8 @@ else: mrregister_log run.command(command) check_linear_transformation(os.path.join('linear_transforms_%i' % level, '%s.txt' % i.prefix), command, pause_on_warn=do_pause_on_warn) + progress.increment('Optimising template with linear registration (stage {0} of {1}, {2} of {3} subjects)'.format(level+1, len(linear_scales), counter+1, len(inputs))) + progress.done() # Here we ensure the template doesn't drift or scale run.command('transformcalc ' + allindir('linear_transforms_%i' % level) + ' average linear_transform_average.txt -force -quiet') @@ -617,7 +641,7 @@ else: transform = dot(loadtxt(os.path.join('linear_transforms_%i' % level, '%s.txt' % i.prefix)), average_inv) savetxt(os.path.join('linear_transforms_%i' % level, '%s.txt' % i.prefix), transform) - + progress = app.progressBar('Transforming all subjects to revised template', len(inputs)) for i in inputs: run.command('mrtransform ' + abspath(i.directory, i.filename) + ' ' + \ '-template ' + current_template + ' ' + \ @@ -625,6 +649,8 @@ else: os.path.join('inputs_transformed', '%s.mif' % i.prefix) + \ datatype + ' ' + \ '-force') + progress.increment() + progress.done() run.command('mrmath ' + allindir('inputs_transformed') + ' mean linear_template' + str(level) + '.mif -force') current_template = 'linear_template' + str(level) + '.mif' @@ -634,6 +660,7 @@ else: # Create a template mask for nl registration by taking the intersection of all transformed input masks and dilating if useMasks and (dononlinear or app.args.template_mask): + progress = app.progressBar('Generating template mask for non-linear registration', len(inputs)) for i in inputs: run.command('mrtransform ' + abspath(i.mask_directory, i.mask_filename) + ' ' + \ '-template ' + current_template + ' ' + \ @@ -641,15 +668,17 @@ if useMasks and (dononlinear or app.args.template_mask): '-linear ' + os.path.join('linear_transforms', '%s.txt' % i.prefix) + ' ' + \ os.path.join('masks_transformed', '%s.mif' % i.prefix) + ' ' + \ '-force') + progress.increment() + progress.done() run.command ('mrmath ' + allindir('masks_transformed') + ' min - | maskfilter - median - | maskfilter - dilate -npass 5 init_nl_template_mask.mif -force') current_template_mask = 'init_nl_template_mask.mif' if dononlinear: # Optimise the template with non-linear registration - app.console('Optimising template with non-linear registration') file.makeDir('warps') for level in range(0, len(nl_scales)): - for i in inputs: + progress = app.progressBar('Optimising template with non-linear registration (stage {0} of {1}, 0 of {2} subjects)'.format(level+1, len(nl_scales), len(inputs)), len(inputs)) + for counter, i in enumerate(inputs): if level > 0: initialise = ' -nl_init ' + os.path.join('warps_%i' % (level-1), '%s.mif' % i.prefix) scale = '' @@ -693,6 +722,8 @@ if dononlinear: os.path.join('masks_transformed', i.prefix + '.mif') + ' ' + \ '-interp nearest ' + '-force') + progress.increment('Optimising template with non-linear registration (stage {0} of {1}, {2} of {3} subjects)'.format(level+1, len(nl_scales), counter+1, len(inputs))) + progress.done() run.command('mrmath ' + allindir('inputs_transformed') + ' mean nl_template' + str(level) + '.mif') current_template = 'nl_template' + str(level) + '.mif' diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index c4be38a852..cd38b38561 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -152,6 +152,8 @@ def parse(): #pylint: disable=unused-variable use_colour = True if 'TerminalColor' in config: use_colour = config['TerminalColor'].lower() in ('yes', 'true', '1') + if not sys.stderr.isatty(): + use_colour = False if use_colour: clearLine = '\033[0K' colourClear = '\033[0m' @@ -631,8 +633,10 @@ def appVersion(): process.communicate(s.encode()) except: sys.stdout.write(s) + sys.stdout.flush() else: sys.stdout.write(s) + sys.stdout.flush() def printFullUsage(self): import sys @@ -664,6 +668,7 @@ def printFullUsage(self): sys.stdout.write('ARGUMENT ' + arg + ' 0 0\n') else: sys.stdout.write('ARGUMENT ' + option.metavar + ' 0 0\n') + sys.stdout.flush() def printUsageMarkdown(self): import os, subprocess, sys @@ -714,8 +719,8 @@ def printUsageMarkdown(self): s += '**Author:** ' + self._author + '\n\n' s += '**Copyright:** ' + self._copyright + '\n\n' sys.stdout.write(s) + sys.stdout.flush() if self._subparsers: - sys.stdout.flush() for alg in self._subparsers._group_actions[0].choices: subprocess.call ([ sys.executable, os.path.realpath(sys.argv[0]), alg, '__print_usage_markdown__' ]) @@ -785,8 +790,8 @@ def printUsageRst(self): s += '**Author:** ' + self._author + '\n\n' s += '**Copyright:** ' + self._copyright + '\n\n' sys.stdout.write(s) + sys.stdout.flush() if self._subparsers: - sys.stdout.flush() for alg in self._subparsers._group_actions[0].choices: subprocess.call ([ sys.executable, os.path.realpath(sys.argv[0]), alg, '__print_usage_rst__' ]) @@ -796,34 +801,78 @@ def printUsageRst(self): # mimicing the behaviour of MRtrix3 binary commands class progressBar(object): #pylint: disable=unused-variable + _busy = [ '. ', + ' . ', + ' . ', + ' .', + ' . ', + ' . ' ] + def _update(self): - import os, sys + import sys global clearLine, colourConsole, colourClear, colourExec - sys.stderr.write('\r' + os.path.basename(sys.argv[0]) + ': ' + colourExec + '[{0:>3}%] '.format(int(round(100.0*self.counter/self.target))) + colourConsole + self.message + '...' + colourClear + clearLine + self.newline) + assert not self.iscomplete + if self.isatty: + sys.stderr.write('\r' + self.scriptname + ': ' + colourExec + '[' + ('{0:>3}%'.format(self.value) if self.multiplier else progressBar._busy[self.counter%6]) + '] ' + colourConsole + self.message + '... ' + colourClear + clearLine + self.newline) + else: + if self.newline: + sys.stderr.write(self.scriptname + ': ' + self.message + '... [' + ('=' * int(self.value/2)) + self.newline) + else: + sys.stderr.write('=' * (int(self.value/2) - int(self.old_value/2))) sys.stderr.flush() - def __init__(self, msg, target): + def __init__(self, msg, target=0): + import os, sys global verbosity self.counter = 0 + self.isatty = sys.stderr.isatty() + self.iscomplete = False self.message = msg + self.multiplier = 100.0/target if target else 0 self.newline = '\n' if verbosity > 1 else '' # If any more than default verbosity, may still get details printed in between progress updates + self.old_value = 0 self.origverbosity = verbosity - self.target = target + self.scriptname = os.path.basename(sys.argv[0]) + self.value = 0 verbosity = verbosity - 1 if verbosity else 0 - self._update() + if self.isatty: + sys.stderr.write(self.scriptname + ': ' + colourExec + '[' + ('{0:>3}%'.format(self.value) if self.multiplier else progressBar._busy[0]) + '] ' + colourConsole + self.message + '... ' + colourClear + clearLine + self.newline) + else: + sys.stderr.write(self.scriptname + ': ' + self.message + '... [' + self.newline) + sys.stderr.flush() def increment(self, msg=''): + import math + assert not self.iscomplete + self.counter += 1 + force_update = False if msg: self.message = msg - self.counter += 1 - self._update() + force_update = True + if self.multiplier: + new_value = int(round(self.counter * self.multiplier)) + else: + new_value = math.log(self.counter, 2) + if new_value != self.value: + self.old_value = self.value + self.value = new_value + force_update = True + if force_update: + self._update() def done(self): - import os, sys + import sys global verbosity global clearLine, colourConsole, colourClear, colourExec - self.counter = self.target - sys.stderr.write('\r' + os.path.basename(sys.argv[0]) + ': ' + colourExec + '[100%] ' + colourConsole + self.message + colourClear + clearLine + '\n') + self.iscomplete = True + self.value = 100 + if self.isatty: + sys.stderr.write('\r' + self.scriptname + ': ' + colourExec + '[' + ('100%' if self.multiplier else 'done') + '] ' + colourConsole + self.message + colourClear + clearLine + '\n') + else: + if self.newline: + sys.stderr.write(self.scriptname + ': ' + self.message + ' [' + ('=' * (self.value/2)) + ']\n') + else: + sys.stderr.write('=' * (int(self.value/2) - int(self.old_value/2)) + ']\n') sys.stderr.flush() verbosity = self.origverbosity diff --git a/lib/mrtrix3/run.py b/lib/mrtrix3/run.py index 2712c36755..4905c5acfb 100644 --- a/lib/mrtrix3/run.py +++ b/lib/mrtrix3/run.py @@ -113,8 +113,6 @@ def command(cmd, exitOnError=True): #pylint: disable=unused-variable p.terminate() _processes = [ ] break - except (KeyboardInterrupt, SystemExit): - app.handler(signal.SIGINT, inspect.currentframe()) return_stdout = '' return_stderr = '' @@ -122,31 +120,27 @@ def command(cmd, exitOnError=True): #pylint: disable=unused-variable error_text = '' # Wait for all commands to complete - try: - - # Switch how we monitor running processes / wait for them to complete - # depending on whether or not the user has specified -verbose or -debug option - if app.verbosity > 1: - for process in _processes: - stderrdata = '' - while True: - # Have to read one character at a time: Waiting for a newline character using e.g. readline() will prevent MRtrix progressbars from appearing - line = process.stderr.read(1).decode('utf-8') - sys.stderr.write(line) - sys.stderr.flush() - stderrdata += line - if not line and process.poll() is not None: - break - return_stderr += stderrdata - if process.returncode: - error = True - error_text += stderrdata - else: - for process in _processes: - process.wait() + # Switch how we monitor running processes / wait for them to complete + # depending on whether or not the user has specified -info or -debug option + if app.verbosity > 1: + for process in _processes: + stderrdata = '' + while True: + # Have to read one character at a time: Waiting for a newline character using e.g. readline() will prevent MRtrix progressbars from appearing + line = process.stderr.read(1).decode('utf-8') + sys.stderr.write(line) + sys.stderr.flush() + stderrdata += line + if not line and process.poll() is not None: + break + return_stderr += stderrdata + if process.returncode: + error = True + error_text += stderrdata + else: + for process in _processes: + process.wait() - except (KeyboardInterrupt, SystemExit): - raise # For any command stdout / stderr data that wasn't either passed to another command or # printed to the terminal during execution, read it here. From 08f50794b4437bd9940d84c20d51f26188be97e7 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 12 Sep 2017 11:26:57 +1000 Subject: [PATCH 147/538] Import new labelconvert test data to main repo --- testing/data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/data b/testing/data index 72e0a40550..24457b3a66 160000 --- a/testing/data +++ b/testing/data @@ -1 +1 @@ -Subproject commit 72e0a4055092a9f180fd77a7f6096df90b7622c0 +Subproject commit 24457b3a664e5aa3b9e24a1ecb6cf064f1754a3c From 2956b2443c7f0b46a3447297c6fc386ff0374ed7 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 12 Sep 2017 14:51:39 +1000 Subject: [PATCH 148/538] Scripts: Improved Ctrl-C handling If a keyboard interrupt occurs during standard processing, it should be caught by the custom signal handler, appropriately shutting down the script. If however it occurs during a run.command() call, it is necessary to instead catch the KeyboardInterrupt exception, such that any I/O calls go out of context and the subprocess threads can be properly shut down. --- lib/mrtrix3/app.py | 12 +++++++++-- lib/mrtrix3/run.py | 54 +++++++++++++++++++++++++++++----------------- 2 files changed, 44 insertions(+), 22 deletions(-) diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index cd38b38561..e0c5ec28d1 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -892,15 +892,23 @@ def isWindows(): #pylint: disable=unused-variable def handler(signum, _frame): import os, signal, sys global _signals - # First, kill any child processes + # Ignore any other incoming signals + for s in _signals: + try: + signal.signal(getattr(signal, s), signal.SIG_IGN) + except: + pass + # Kill any child processes in the run module try: from mrtrix3.run import _processes for p in _processes: if p: p.terminate() + p.communicate() # Flushes the I/O buffers _processes = [ ] except ImportError: pass + # Generate the error message msg = '[SYSTEM FATAL CODE: ' signal_found = False for (key, value) in _signals.items(): @@ -913,6 +921,6 @@ def handler(signum, _frame): pass if not signal_found: msg += '?] Unknown system signal' - sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + colourError + msg + colourClear + '\n') + sys.stderr.write('\n' + os.path.basename(sys.argv[0]) + ': ' + colourError + msg + colourClear + '\n') complete() exit(signum) diff --git a/lib/mrtrix3/run.py b/lib/mrtrix3/run.py index 4905c5acfb..89bd68ddbd 100644 --- a/lib/mrtrix3/run.py +++ b/lib/mrtrix3/run.py @@ -67,13 +67,19 @@ def command(cmd, exitOnError=True): #pylint: disable=unused-variable app.debug('To execute: ' + str(cmdstack)) + # Disable interrupt signal handler while threads are running + try: + signal.signal(signal.SIGINT, signal.default_int_handler) + except: + pass + # Construct temporary text files for holding stdout / stderr contents when appropriate # (One entry per process; each is a tuple containing two entries, each of which is either a # file-like object, or None) tempfiles = [ ] # Execute all processes - _processes = [ ] + assert not _processes for index, to_execute in enumerate(cmdstack): file_out = None file_err = None @@ -100,7 +106,7 @@ def command(cmd, exitOnError=True): #pylint: disable=unused-variable handle_err = file_err.fileno() # Set off the processes try: - process = subprocess.Popen (to_execute, stdin=handle_in, stdout=handle_out, stderr=handle_err) + process = subprocess.Popen (to_execute, stdin=handle_in, stdout=handle_out, stderr=handle_err, preexec_fn=os.setpgrp) _processes.append(process) tempfiles.append( ( file_out, file_err ) ) # FileNotFoundError not defined in Python 2.7 @@ -122,25 +128,33 @@ def command(cmd, exitOnError=True): #pylint: disable=unused-variable # Wait for all commands to complete # Switch how we monitor running processes / wait for them to complete # depending on whether or not the user has specified -info or -debug option - if app.verbosity > 1: - for process in _processes: - stderrdata = '' - while True: - # Have to read one character at a time: Waiting for a newline character using e.g. readline() will prevent MRtrix progressbars from appearing - line = process.stderr.read(1).decode('utf-8') - sys.stderr.write(line) - sys.stderr.flush() - stderrdata += line - if not line and process.poll() is not None: - break - return_stderr += stderrdata - if process.returncode: - error = True - error_text += stderrdata - else: - for process in _processes: - process.wait() + try: + if app.verbosity > 1: + for process in _processes: + stderrdata = '' + while True: + # Have to read one character at a time: Waiting for a newline character using e.g. readline() will prevent MRtrix progressbars from appearing + line = process.stderr.read(1).decode('utf-8') + sys.stderr.write(line) + sys.stderr.flush() + stderrdata += line + if not line and process.poll() is not None: + break + return_stderr += stderrdata + if process.returncode: + error = True + error_text += stderrdata + else: + for process in _processes: + process.wait() + except (KeyboardInterrupt, SystemExit): + app.handler(signal.SIGINT, inspect.currentframe()) + # Re-enable interrupt signal handler + try: + signal.signal(signal.SIGINT, app.handler) + except: + pass # For any command stdout / stderr data that wasn't either passed to another command or # printed to the terminal during execution, read it here. From 921c9aa2a40a6d6aced617bdbf0441358b5e1f85 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 12 Sep 2017 15:29:33 +1000 Subject: [PATCH 149/538] Fixes for testing - population_template: Simplify progress bars - Merge updated testing data with 'dev' branch. - Fix labelconvert test; incorrect path to file. --- bin/population_template | 8 ++++---- testing/data | 2 +- testing/tests/labelconvert | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/population_template b/bin/population_template index 7eaa99348b..c7ab20c2a8 100755 --- a/bin/population_template +++ b/bin/population_template @@ -571,7 +571,7 @@ if not dolinear: run.function(copy, os.path.join('linear_transforms_initial','%s.txt' % (i.prefix)), os.path.join('linear_transforms','%s.txt' % (i.prefix))) else: for level in range(0, len(linear_scales)): - progress = app.progressBar('Optimising template with linear registration (stage {0} of {1}, 0 of {2} subjects)'.format(level+1, len(linear_scales), len(inputs)), len(inputs)) + progress = app.progressBar('Optimising template with linear registration (stage {0} of {1})'.format(level+1, len(linear_scales)), len(inputs)) for counter, i in enumerate(inputs): initialise = '' if useMasks: @@ -626,7 +626,7 @@ else: mrregister_log run.command(command) check_linear_transformation(os.path.join('linear_transforms_%i' % level, '%s.txt' % i.prefix), command, pause_on_warn=do_pause_on_warn) - progress.increment('Optimising template with linear registration (stage {0} of {1}, {2} of {3} subjects)'.format(level+1, len(linear_scales), counter+1, len(inputs))) + progress.increment() progress.done() # Here we ensure the template doesn't drift or scale @@ -677,7 +677,7 @@ if dononlinear: # Optimise the template with non-linear registration file.makeDir('warps') for level in range(0, len(nl_scales)): - progress = app.progressBar('Optimising template with non-linear registration (stage {0} of {1}, 0 of {2} subjects)'.format(level+1, len(nl_scales), len(inputs)), len(inputs)) + progress = app.progressBar('Optimising template with non-linear registration (stage {0} of {1})'.format(level+1, len(nl_scales)), len(inputs)) for counter, i in enumerate(inputs): if level > 0: initialise = ' -nl_init ' + os.path.join('warps_%i' % (level-1), '%s.mif' % i.prefix) @@ -722,7 +722,7 @@ if dononlinear: os.path.join('masks_transformed', i.prefix + '.mif') + ' ' + \ '-interp nearest ' + '-force') - progress.increment('Optimising template with non-linear registration (stage {0} of {1}, {2} of {3} subjects)'.format(level+1, len(nl_scales), counter+1, len(inputs))) + progress.increment() progress.done() run.command('mrmath ' + allindir('inputs_transformed') + ' mean nl_template' + str(level) + '.mif') diff --git a/testing/data b/testing/data index 24457b3a66..a12d572926 160000 --- a/testing/data +++ b/testing/data @@ -1 +1 @@ -Subproject commit 24457b3a664e5aa3b9e24a1ecb6cf064f1754a3c +Subproject commit a12d5729264bc03db223aad9dcc27859a29af95f diff --git a/testing/tests/labelconvert b/testing/tests/labelconvert index 894680aaf1..6e8b96a98d 100644 --- a/testing/tests/labelconvert +++ b/testing/tests/labelconvert @@ -1,4 +1,4 @@ labelconvert labelconvert/in_aal.mif.gz labelconvert/ROI_MNI_V4.txt labelconvert/aal.txt - | testing_diff_image - labelconvert/out_aal.mif.gz labelconvert labelconvert/in_fs.mif.gz labelconvert/FreeSurferColorLUT.txt labelconvert/fs_default.txt - | testing_diff_image - labelconvert/out_fs.mif.gz labelconvert labelconvert/in_iit.mif.gz labelconvert/LUT_GM.txt labelconvert/fs_a2009s.txt - | testing_diff_image - labelconvert/out_iit.mif.gz -labelconvert labelconvert/in_lpba40.mif.gz labelconvert/LPBA40-labels.txt lpba40.txt - | testing_diff_image - labelconvert/out_lpba40.mif.gz +labelconvert labelconvert/in_lpba40.mif.gz labelconvert/LPBA40-labels.txt labelconvert/lpba40.txt - | testing_diff_image - labelconvert/out_lpba40.mif.gz From 4b15b0d9c71787163edc901a33d108cbc1272b37 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 12 Sep 2017 16:35:35 +1000 Subject: [PATCH 150/538] population_template: Fix for pylint Issue introduced in 921c9aa. --- bin/population_template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/population_template b/bin/population_template index c7ab20c2a8..52bca9b2de 100755 --- a/bin/population_template +++ b/bin/population_template @@ -572,7 +572,7 @@ if not dolinear: else: for level in range(0, len(linear_scales)): progress = app.progressBar('Optimising template with linear registration (stage {0} of {1})'.format(level+1, len(linear_scales)), len(inputs)) - for counter, i in enumerate(inputs): + for i in inputs: initialise = '' if useMasks: mask = ' -mask1 ' + abspath(i.mask_directory, i.mask_filename) @@ -678,7 +678,7 @@ if dononlinear: file.makeDir('warps') for level in range(0, len(nl_scales)): progress = app.progressBar('Optimising template with non-linear registration (stage {0} of {1})'.format(level+1, len(nl_scales)), len(inputs)) - for counter, i in enumerate(inputs): + for i in inputs: if level > 0: initialise = ' -nl_init ' + os.path.join('warps_%i' % (level-1), '%s.mif' % i.prefix) scale = '' From 111855e6f0895f763a766c147ec36da63328300b Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Tue, 12 Sep 2017 17:17:22 +1000 Subject: [PATCH 151/538] ongoing docs: 'msmt_5tt' details and differences with the paper --- .../response_function_estimation.rst | 53 ++++++------------- 1 file changed, 17 insertions(+), 36 deletions(-) diff --git a/docs/constrained_spherical_deconvolution/response_function_estimation.rst b/docs/constrained_spherical_deconvolution/response_function_estimation.rst index 5ef0d28c7c..7996234308 100644 --- a/docs/constrained_spherical_deconvolution/response_function_estimation.rst +++ b/docs/constrained_spherical_deconvolution/response_function_estimation.rst @@ -150,42 +150,23 @@ For more information, refer to the 'msmt_5tt' algorithm ^^^^^^^^^^^^^^^^^^^^ -This algorithm is intended for deriving multi-shell, multi-tissue -response functions that are compatible with the new Multi-Shell -Multi-Tissue (MSMT) CSD algorithm. The response function estimation -algorithm is identical to that described in `the -manuscript `__: -As long as EPI inhomogeneity field correction has been performed, and a -tissue-segmented anatomical image (prepared in the 5TT format for -:ref:`ACT `) is provided with good -prior rigid-body alignment to the diffusion images, then these -high-resolution tissue segmentations can be used to identify -single-tissue voxels in the diffusion images. This algorithm is -hard-wired to provide response functions for the most typical use case -for MSMT CSD: An isotropic grey matter response, an anisotropic white -matter response, and an isotropic CSF response; the output response -functions are provided in the format expected by the :ref:`dwi2fod` -command. Those wishing to experiment with different multi-tissue -response function configurations will need to use the ``manual`` -algorithm (which will provide a multi-shell response function if the -input DWI contains such data). - -For reference, this algorithm operates as follows: - -1. Resample the 5TT segmented image to diffusion image space. - -2. For each of the three tissues (WM, GM, CSF), select those voxels that - obey the following criteria: - -- The tissue partial volume fraction must be at least 0.95. - -- For GM and CSF, the FA must be no larger than 0.2. - -3. For WM, use the mask derived from step 2 as the initialisation to the - ``tournier`` algorithm, to select single-fibre voxels. - -4. Derive a multi-shell response for each tissue for each of these three - tissues. For GM and CSF, use *lmax=0* for all shells. +This algorithm is an implementation of the strategy proposed in +`Jeurissen et al. (2014) `__ +to estimate multi b-value (multi-shell) response functions of +single-fibre white matter (*anisotropic*), grey matter and CSF +(both *isotropic*), which can subsequently be used for multi-tissue +(constrained) spherical deconvolution. The algorithm is primarily +driven by a prior ('5TT') tissue segmentation, typically obtained +from a spatially aligned anatomical image. This also requires correction +for susceptibility-induced (EPI) distortions of the DWI dataset. +The algorithm selects voxels with a segmentation partial volume of at +least 0.95 for each tissue type. Grey matter and CSF are further +constrained by an (upper) 0.2 FA threshold. A notable difference between +this implementation and the algorithm described in `Jeurissen et al. (2014) +`__ +is the criterium to extract single-fibre voxels from the white matter +segmentation: this implementation calls upon the ``tournier`` algorithm +to do so, while the paper uses a simple (lower) 0.7 FA threshold. For more information, refer to the :ref:`msmt_5tt algorithm documentation `. From 72315378fab4cd2fda36444a749fd278fbe5a3e0 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 13 Sep 2017 19:16:16 +1000 Subject: [PATCH 152/538] Fixes for TravisCI backend changes --- .travis.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 729323f267..5f907c7381 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ sudo: false +dist: trusty language: cpp addons: apt: @@ -22,18 +23,20 @@ install: - export PYTHONPATH=`pwd`/lib:${PYTHONPATH} - export EIGEN_CFLAGS=-I`pwd`/../eigen - (cd ..; hg clone https://bitbucket.org/eigen/eigen/; cd eigen; hg update 3.3) - - pip install pylint recommonmark sphinx sphinx-rtd-theme - - pip3 install pylint recommonmark sphinx sphinx-rtd-theme + - pip install urllib3[secure] + - pip install --user pylint recommonmark sphinx sphinx-rtd-theme + - pip3 install --user pylint recommonmark sphinx sphinx-rtd-theme script: - ${py} -m sphinx -n -N -W -w sphinx.log -c docs/ docs/ tmp/ - - ./check_memalign && $py ./configure -assert && $py ./build -nowarnings && PYTHON=$py ./run_pylint && ./run_tests + - ./check_memalign && $py ./configure -assert && $py ./build -nowarnings && ./run_tests + - PYTHON=$py ./run_pylint - ./docs/generate_user_docs.sh && git diff --exit-code docs/ > gitdiff.log || echo "Documentation is not up to date; run docs/generate_user_docs.sh and commit changes" after_failure: - cat sphinx.log - cat memalign.log - cat configure.log - - cat pylint.log - cat build.log - cat testing.log + - cat pylint.log - cat gitdiff.log - sleep 10 From 85bae07e53b9b0d25e13ee54857976ea203fbc72 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 15 Sep 2017 11:03:27 +1000 Subject: [PATCH 153/538] Fix compiler warnings: mrinfo and mapper_plugins.cpp --- cmd/mrinfo.cpp | 4 ++-- src/dwi/tractography/mapping/mapper_plugins.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/mrinfo.cpp b/cmd/mrinfo.cpp index d94ef67a80..d84c89564b 100644 --- a/cmd/mrinfo.cpp +++ b/cmd/mrinfo.cpp @@ -197,9 +197,9 @@ void keyval2json (const Header& header, JSON& json) // converted to numerical matrices / vectors and written as such try { const auto M = parse_matrix (kv.second); - for (size_t row = 0; row != M.rows(); ++row) { + for (ssize_t row = 0; row != M.rows(); ++row) { vector data (M.cols()); - for (size_t i = 0; i != M.cols(); ++i) + for (ssize_t i = 0; i != M.cols(); ++i) data[i] = M (row, i); if (json.find (kv.first) == json.end()) json[kv.first] = { data }; diff --git a/src/dwi/tractography/mapping/mapper_plugins.cpp b/src/dwi/tractography/mapping/mapper_plugins.cpp index 2957bba519..05c469fcd1 100644 --- a/src/dwi/tractography/mapping/mapper_plugins.cpp +++ b/src/dwi/tractography/mapping/mapper_plugins.cpp @@ -64,7 +64,7 @@ namespace MR { for (; index >= 0 && index < ssize_t(tck.size()); index += step) { const Eigen::Vector3 p = interp.scanner2voxel * tck[index].cast(); - const Eigen::Array3i v ( { std::round (p[0]), std::round (p[1]), std::round (p[2]) } ); + const Eigen::Array3i v ( { int(std::round (p[0])), int(std::round (p[1])), int(std::round (p[2])) } ); if (!is_out_of_bounds (backtrack_mask, v)) { assign_pos_of (v, 0, 3).to (backtrack_mask); if (backtrack_mask.value()) @@ -240,7 +240,7 @@ namespace MR { if (!interp.scanner (tck[index])) return; values[tck_end_index].reserve (kernel.size()); - for (ssize_t i = 0; i != kernel.size(); ++i) { + for (size_t i = 0; i != kernel.size(); ++i) { interp.index(3) = sample_centre - kernel_centre + i; if (interp.index(3) >= 0 && interp.index(3) < interp.size(3)) values[tck_end_index].push_back (interp.value()); From 6189e4eebd03cb1191c288f1b407286812069a78 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 15 Sep 2017 14:37:32 +1000 Subject: [PATCH 154/538] image.Header: Add missing transform() member --- lib/mrtrix3/image.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/mrtrix3/image.py b/lib/mrtrix3/image.py index d71aab1b91..534846b4b9 100644 --- a/lib/mrtrix3/image.py +++ b/lib/mrtrix3/image.py @@ -57,6 +57,8 @@ def intensity_offset(self): return self._intensity_offset def intensity_scale(self): return self._intensity_scale + def transform(self): + return self._transform def keyval(self): return self._keyval From 6a2eb999703a7b1912b81a52e8ae4cf02c4e11a8 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 18 Sep 2017 09:42:44 +1000 Subject: [PATCH 155/538] labelsgmfix: Upsample T1 if low-resolution A similar heurisstic was implemented for 5ttgen fsl previously. --- bin/labelsgmfix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bin/labelsgmfix b/bin/labelsgmfix index 8860b4d727..df5de89111 100755 --- a/bin/labelsgmfix +++ b/bin/labelsgmfix @@ -61,11 +61,23 @@ if app.args.sgm_amyg_hipp: structure_map.update({ 'L_Amyg':'Left-Amygdala', 'R_Amyg':'Right-Amygdala', 'L_Hipp':'Left-Hippocampus', 'R_Hipp':'Right-Hippocampus' }) +t1_spacing = image.Header(path.fromUser(app.args.t1, False)).spacing() +upsample_for_first = False +# If voxel size is 1.25mm or larger, make a guess that the user has erroneously re-gridded their data +if math.pow(t1_spacing[0] * t1_spacing[1] * t1_spacing[2], 1.0/3.0) > 1.225: + app.warn('Voxel size of input T1 image larger than expected for T1-weighted images (' + str(t1_spacing) + '); ' + 'image will be resampled to 1mm isotropic in order to maximise chance of ' + 'FSL FIRST script succeeding') + upsample_for_first = True + app.makeTempDir() # Get the parcellation and T1 images into the temporary directory, with conversion of the T1 into the correct format for FSL run.command('mrconvert ' + path.fromUser(app.args.parc, True) + ' ' + path.toTemp('parc.mif', True)) -run.command('mrconvert ' + path.fromUser(app.args.t1, True) + ' ' + path.toTemp('T1.nii', True) + ' -stride -1,+2,+3') +if upsample_for_first: + run.command('mrresize ' + path.fromUser(app.args.t1, True) + ' - -voxel 1.0 -interp sinc | mrcalc - 0.0 -max - | mrconvert - ' + path.toTemp('T1.nii', True) + ' -stride -1,+2,+3') +else: + run.command('mrconvert ' + path.fromUser(app.args.t1, True) + ' ' + path.toTemp('T1.nii', True) + ' -stride -1,+2,+3') app.gotoTempDir() From 939af3c87cf3a7cbf9a4e6dac71ebe83569786d3 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 19 Sep 2017 11:59:37 +1000 Subject: [PATCH 156/538] labelsgmfix: Fix detection of low-resolution input Missing include statement in commit 6a2eb99. --- bin/labelsgmfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/labelsgmfix b/bin/labelsgmfix index df5de89111..ef2795aa08 100755 --- a/bin/labelsgmfix +++ b/bin/labelsgmfix @@ -9,7 +9,7 @@ # derived from FIRST. # Make the corresponding MRtrix3 Python libraries available -import inspect, os, sys +import inspect, math, os, sys lib_folder = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(inspect.getfile(inspect.currentframe()))), os.pardir, 'lib')) if not os.path.isdir(lib_folder): sys.stderr.write('Unable to locate MRtrix3 Python libraries') From a2eec085f51fb75e845e0a3eb8db73930b038886 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 19 Sep 2017 14:12:33 +1000 Subject: [PATCH 157/538] Various fixes for MRtrix3_connectome script - mrinfo -json_all: Ensure that scalar values are exported to JSON as scalar values, rather than 1x1 matrices. - mrconvert -json_import: Ensure that incoming matrix data is properly formatted for storage in image header key-value fields. - phaseEncoding.getScheme(): Various fixes both for new image.Header class and for proper formatting / conversion of tables produced. --- bin/dwipreproc | 14 +++++++++++--- cmd/mrinfo.cpp | 2 ++ core/file/json_utils.cpp | 12 ++++++++++-- lib/mrtrix3/phaseEncoding.py | 21 +++++++++++---------- 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 52639d76eb..2cfad9b440 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -133,12 +133,13 @@ dwi_header = image.Header('dwi.mif') if not len(dwi_header.size()) == 4: app.error('Input DWI must be a 4D image') num_volumes = dwi_header.size()[3] -dwi_pe_scheme = phaseEncoding.getScheme('dwi.mif') +app.var(num_volumes) +dwi_pe_scheme = phaseEncoding.getScheme(dwi_header) if app.args.se_epi: se_epi_header = image.Header('se_epi.mif') if not len(se_epi_header.size()) == 4: app.error('File provided using -se_epi option must contain more than one image volume') - topup_pe_scheme = phaseEncoding.getScheme('se_epi.mif') + topup_pe_scheme = phaseEncoding.getScheme(se_epi_header) if 'dw_scheme' not in dwi_header.keyval(): app.error('No diffusion gradient table found') grad = dwi_header.keyval()['dw_scheme'] @@ -152,10 +153,11 @@ if not len(grad) == num_volumes: manual_pe_dir = None if app.args.pe_dir: manual_pe_dir = [ float(i) for i in phaseEncoding.direction(app.args.pe_dir) ] +app.var(manual_pe_dir) manual_trt = None if app.args.readout_time: manual_trt = float(app.args.readout_time) - +app.var(manual_trt) do_topup = (not PE_design == 'None') @@ -200,12 +202,14 @@ if manual_pe_dir: line = list(manual_pe_dir) line.append(trt) dwi_manual_pe_scheme = [ line ] * num_volumes + app.var(dwi_manual_pe_scheme) # With 'Pair', also need to construct the manual scheme for SE EPIs elif PE_design == 'Pair': line = list(manual_pe_dir) line.append(trt) dwi_manual_pe_scheme = [ line ] * num_volumes + app.var(dwi_manual_pe_scheme) num_topup_volumes = se_epi_header.size()[3] if num_topup_volumes%2: app.error('If using -rpe_pair option, image provided using -se_epi must contain an even number of volumes') @@ -215,6 +219,7 @@ if manual_pe_dir: line = [ (-i if i else 0.0) for i in manual_pe_dir ] line.append(trt) topup_manual_pe_scheme.extend( [ line ] * int(num_topup_volumes/2) ) + app.var(topup_manual_pe_scheme) # If -rpe_all, need to scan through grad and figure out the pairings # This will be required if relying on user-specified phase encode direction @@ -255,6 +260,7 @@ if manual_pe_dir: line = [ (-i if i else 0.0) for i in line ] line.append(trt) dwi_manual_pe_scheme.append(line) + appp.var(dwi_manual_pe_scheme) else: # No manual phase encode direction defined @@ -612,6 +618,8 @@ else: eddy_config = [ [ float(f) for f in line.split() ] for line in open('eddy_config.txt', 'r').read().split('\n')[:-1] ] eddy_indices = [ int(i) for i in open('eddy_indices.txt', 'r').read().split() ] + app.var(eddy_config) + app.var(eddy_indices) # This section derives, for each phase encoding configuration present, the 'weight' to be applied # to the image during volume recombination, which is based on the Jacobian of the field in the diff --git a/cmd/mrinfo.cpp b/cmd/mrinfo.cpp index d84c89564b..f07b78464d 100644 --- a/cmd/mrinfo.cpp +++ b/cmd/mrinfo.cpp @@ -197,6 +197,8 @@ void keyval2json (const Header& header, JSON& json) // converted to numerical matrices / vectors and written as such try { const auto M = parse_matrix (kv.second); + if (M.rows() == 1 && M.cols() == 1) + throw Exception ("Single scalar value rather than a matrix"); for (ssize_t row = 0; row != M.rows(); ++row) { vector data (M.cols()); for (ssize_t i = 0; i != M.cols(); ++i) diff --git a/core/file/json_utils.cpp b/core/file/json_utils.cpp index cd9baecd1a..756ddd87db 100644 --- a/core/file/json_utils.cpp +++ b/core/file/json_utils.cpp @@ -54,8 +54,16 @@ namespace MR H.keyval().insert (std::make_pair (i.key(), str(i.value()))); } else if (i->is_array()) { vector s; - for (auto j = i->cbegin(); j != i->cend(); ++j) - s.push_back (str(*j)); + for (auto j = i->cbegin(); j != i->cend(); ++j) { + if (j->is_array()) { + vector line; + for (auto k : *j) + line.push_back (str(k)); + s.push_back (join(line, ",")); + } else { + s.push_back (str(*j)); + } + } H.keyval().insert (std::make_pair (i.key(), join(s, "\n"))); } else if (i->is_string()) { const std::string s = i.value(); diff --git a/lib/mrtrix3/phaseEncoding.py b/lib/mrtrix3/phaseEncoding.py index 260b497cbe..37ca465bde 100644 --- a/lib/mrtrix3/phaseEncoding.py +++ b/lib/mrtrix3/phaseEncoding.py @@ -55,14 +55,15 @@ def getScheme(arg): #pylint: disable=unused-variable if not isinstance(arg, str): app.error('Error trying to derive phase-encoding scheme from \'' + str(arg) + '\': Not an image header or file path') arg = image.Header(arg) - if 'pe_scheme' in arg.keyval: - app.debug(arg.keyval['pe_scheme']) - return arg.keyval['pe_scheme'] - if 'PhaseEncodingDirection' not in arg.keyval: + if 'pe_scheme' in arg.keyval(): + app.debug(str(arg.keyval()['pe_scheme'])) + return arg.keyval()['pe_scheme'] + if 'PhaseEncodingDirection' not in arg.keyval(): return None - line = direction(arg.keyval['PhaseEncodingDirection']) - if 'TotalReadoutTime' in arg.keyval: - line.append(arg.keyval['TotalReadoutTime']) - num_volumes = 1 if len(arg.size) < 4 else arg.size[3] - app.debug(str(line) + ' x ' + num_volumes + ' rows') - return line * num_volumes + line = direction(arg.keyval()['PhaseEncodingDirection']) + if 'TotalReadoutTime' in arg.keyval(): + line = [ float(value) for value in line ] + line.append(float(arg.keyval()['TotalReadoutTime'])) + num_volumes = 1 if len(arg.size()) < 4 else arg.size()[3] + app.debug(str(line) + ' x ' + str(num_volumes) + ' rows') + return [ line ] * num_volumes From eb44b745ca6d03a80b0ef699761e2d4d8752c795 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 19 Sep 2017 15:54:29 +1000 Subject: [PATCH 158/538] Scripts: Indent dynamic text output from commands This assists in separating the text output by the running script from text output from the commands it invokes. Similar to what was first implemented in a5caae6 and revised in 1c86d51, but those only applied to the output from failed commands. --- bin/dwipreproc | 2 +- lib/mrtrix3/run.py | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 2cfad9b440..2236ae4c73 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -260,7 +260,7 @@ if manual_pe_dir: line = [ (-i if i else 0.0) for i in line ] line.append(trt) dwi_manual_pe_scheme.append(line) - appp.var(dwi_manual_pe_scheme) + app.var(dwi_manual_pe_scheme) else: # No manual phase encode direction defined diff --git a/lib/mrtrix3/run.py b/lib/mrtrix3/run.py index 89bd68ddbd..5bdfa89ff4 100644 --- a/lib/mrtrix3/run.py +++ b/lib/mrtrix3/run.py @@ -17,7 +17,7 @@ def setContinue(filename): #pylint: disable=unused-variable def command(cmd, exitOnError=True): #pylint: disable=unused-variable - import inspect, itertools, shlex, signal, subprocess, sys, tempfile + import inspect, itertools, shlex, signal, string, subprocess, sys, tempfile from distutils.spawn import find_executable from mrtrix3 import app @@ -61,12 +61,12 @@ def command(cmd, exitOnError=True): #pylint: disable=unused-variable for item in reversed(shebang): line.insert(0, item) + app.debug('To execute: ' + str(cmdstack)) + if app.verbosity: sys.stderr.write(app.colourExec + 'Command:' + app.colourClear + ' ' + cmd + '\n') sys.stderr.flush() - app.debug('To execute: ' + str(cmdstack)) - # Disable interrupt signal handler while threads are running try: signal.signal(signal.SIGINT, signal.default_int_handler) @@ -132,14 +132,20 @@ def command(cmd, exitOnError=True): #pylint: disable=unused-variable if app.verbosity > 1: for process in _processes: stderrdata = '' + do_indent = True while True: # Have to read one character at a time: Waiting for a newline character using e.g. readline() will prevent MRtrix progressbars from appearing - line = process.stderr.read(1).decode('utf-8') - sys.stderr.write(line) - sys.stderr.flush() - stderrdata += line - if not line and process.poll() is not None: + char = process.stderr.read(1).decode('utf-8') + if not char and process.poll() is not None: break + if do_indent and char in string.printable: + sys.stderr.write(' ') + do_indent = False + elif char == '\r' or char == '\n': + do_indent = True + sys.stderr.write(char) + sys.stderr.flush() + stderrdata += char return_stderr += stderrdata if process.returncode: error = True From 76ca3cb3182dd766147aa5cbf9f423094fb50294 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 22 Sep 2017 10:40:03 +1000 Subject: [PATCH 159/538] ProgressBars for dwipreproc and 5ttgen fsl --- bin/dwipreproc | 3 +++ cmd/fixelcorrespondence.cpp | 2 +- lib/mrtrix3/_5ttgen/fsl.py | 6 ++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 2236ae4c73..82b941275e 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -647,6 +647,7 @@ else: # This section extracts the two volumes corresponding to each reversed phase-encoded volume pair, and # derives a single image volume based on the recombination equation combined_image_list = [ ] + progress = app.progressBar('Performing explicit volume recombination', len(volume_pairs)) for index, volumes in enumerate(volume_pairs): pe_indices = [ eddy_indices[i] for i in volumes ] run.command('mrconvert ' + eddy_output + ' volume0.mif -coord 3 ' + str(volumes[0])) @@ -656,6 +657,8 @@ else: combined_image_list.append('combined' + str(index) + '.mif') run.function(os.remove, 'volume0.mif') run.function(os.remove, 'volume1.mif') + progress.increment() + progress.done() file.delTemporary(eddy_output) for index in range(0, len(eddy_config)): diff --git a/cmd/fixelcorrespondence.cpp b/cmd/fixelcorrespondence.cpp index f2e8635e68..5a3a78540a 100644 --- a/cmd/fixelcorrespondence.cpp +++ b/cmd/fixelcorrespondence.cpp @@ -75,7 +75,7 @@ void run () output_data_header.size(1) = 1; auto output_data = Image::create (Path::join (output_fixel_directory, argument[3]), output_data_header); - for (auto i = Loop ("mapping subject fixels data to template fixels", template_index, 0, 3)(template_index, subject_index); i; ++i) { + for (auto i = Loop ("mapping subject fixel data to template fixels", template_index, 0, 3)(template_index, subject_index); i; ++i) { template_index.index(3) = 0; uint32_t nfixels_template = template_index.value(); template_index.index(3) = 1; diff --git a/lib/mrtrix3/_5ttgen/fsl.py b/lib/mrtrix3/_5ttgen/fsl.py index caaf8f484b..649d93fd01 100644 --- a/lib/mrtrix3/_5ttgen/fsl.py +++ b/lib/mrtrix3/_5ttgen/fsl.py @@ -176,6 +176,7 @@ def execute(): #pylint: disable=unused-variable # Convert FIRST meshes to partial volume images pve_image_list = [ ] + progress = app.progressBar('Generating partial volume images for SGM structures', len(sgm_structures)) for struct in sgm_structures: pve_image_path = 'mesh2pve_' + struct + '.mif' vtk_in_path = 'first-' + struct + '_first.vtk' @@ -183,8 +184,9 @@ def execute(): #pylint: disable=unused-variable run.command('meshconvert ' + vtk_in_path + ' ' + vtk_temp_path + ' -transform first2real ' + first_input) run.command('mesh2pve ' + vtk_temp_path + ' ' + fast_t1_input + ' ' + pve_image_path) pve_image_list.append(pve_image_path) - pve_cat = ' '.join(pve_image_list) - run.command('mrmath ' + pve_cat + ' sum - | mrcalc - 1.0 -min all_sgms.mif') + progress.increment() + progress.done() + run.command('mrmath ' + ' '.join(pve_image_list) + ' sum - | mrcalc - 1.0 -min all_sgms.mif') # Combine the tissue images into the 5TT format within the script itself fast_output_prefix = fast_t1_input.split('.')[0] From 6b9fade291c70eb01d56199ea8641cb1dae531fc Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 22 Sep 2017 15:17:20 +1000 Subject: [PATCH 160/538] dwipreproc: Fix incorrect image path when cropping --- bin/dwipreproc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 82b941275e..0364c91829 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -427,7 +427,7 @@ if do_topup: crop_option += ' -axis ' + str(axis) + ' 1 ' + str(int(axis_size)-1) if crop_option: app.warn('Topup images contain at least one non-even dimension; cropping images for topup compatibility') - run.command('mrcrop se_epi.mif topup_in_crop.mif' + crop_option) + run.command('mrcrop se_epi.mif se_epi_crop.mif' + crop_option) file.delTemporary('se_epi.mif') topup_in_path = 'se_epi_crop.mif' From 54faeb612f97b0006d22abe06cad165106a0b89d Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 26 Sep 2017 11:03:37 +1000 Subject: [PATCH 161/538] fsl.findImage(): Fix for MRtrix3_connectome script When the image being sought resides in a directory that contains a period character (such as the default produced by the fsl_anat script), the original function would extract the basename of the directory path, rather than the basename of the image file. This change ensures that the full directory path to the image being sought is included in the search path. --- lib/mrtrix3/fsl.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/mrtrix3/fsl.py b/lib/mrtrix3/fsl.py index 21493d3f55..d8709fffb8 100644 --- a/lib/mrtrix3/fsl.py +++ b/lib/mrtrix3/fsl.py @@ -74,14 +74,14 @@ def exeName(name): #pylint: disable=unused-variable def findImage(name): #pylint: disable=unused-variable import os from mrtrix3 import app - basename = name.split('.')[0] - if os.path.isfile(basename + suffix()): - app.debug('Image at expected location: \"' + basename + suffix() + '\"') - return basename + suffix() + prefix = os.path.join(os.path.dirname(name), os.path.basename(name).split('.')[0]) + if os.path.isfile(prefix + suffix()): + app.debug('Image at expected location: \"' + prefix + suffix() + '\"') + return prefix + suffix() for suf in ['.nii', '.nii.gz', '.img']: - if os.path.isfile(basename + suf): - app.debug('Expected image at \"' + basename + suffix() + '\", but found at \"' + basename + suf + '\"') - return basename + suf + if os.path.isfile(prefix + suf): + app.debug('Expected image at \"' + prefix + suffix() + '\", but found at \"' + prefix + suf + '\"') + return prefix + suf app.error('Unable to find FSL output file for path \"' + name + '\"') From 4db5aa0201ba9dee929518c5e0726832a92c08ff Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Tue, 26 Sep 2017 10:40:02 +0100 Subject: [PATCH 162/538] configure: add linker flags to strip unnecessary dependencies --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 361a0aa6cd..d2d794729c 100755 --- a/configure +++ b/configure @@ -243,13 +243,13 @@ cxx_args = '-c CFLAGS SRC -o OBJECT'.split() cpp_flags = [ '-std=c++11' ] ld_args = 'OBJECTS LDFLAGS -o EXECUTABLE'.split() -ld_flags = [ ] +ld_flags = [ '-Wl,-O1,--sort-common,--as-needed' ] if static: ld_flags += [ '-static', '-Wl,-u,pthread_cancel,-u,pthread_cond_broadcast,-u,pthread_cond_destroy,-u,pthread_cond_signal,-u,pthread_cond_wait,-u,pthread_create,-u,pthread_detach,-u,pthread_cond_signal,-u,pthread_equal,-u,pthread_join,-u,pthread_mutex_lock,-u,pthread_mutex_unlock,-u,pthread_once,-u,pthread_setcancelstate' ] ld_lib_args = 'OBJECTS LDLIB_FLAGS -o LIB'.split() -ld_lib_flags = [ ] +ld_lib_flags = [ '-Wl,-O1,--sort-common,--as-needed' ] class TempFile: From 091e5ea8be1e209e4d80e754dfe0eaccd91e39e7 Mon Sep 17 00:00:00 2001 From: Daan Christiaens Date: Tue, 26 Sep 2017 15:46:48 +0100 Subject: [PATCH 163/538] Fix mrcat for complex-valued images. --- cmd/mrcat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/mrcat.cpp b/cmd/mrcat.cpp index d718076df0..ad362eeb7c 100644 --- a/cmd/mrcat.cpp +++ b/cmd/mrcat.cpp @@ -50,7 +50,7 @@ OPTIONS } -using value_type = float; +using value_type = cfloat; void run () { From df0ecd528cba733e225807c40b3a78d22416ba72 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Wed, 27 Sep 2017 18:13:00 +1000 Subject: [PATCH 164/538] re-tuning N4BiasFieldCorrection parameters once more ...to avoid issues for dwi2mask subsequently. --- bin/dwibiascorrect | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/dwibiascorrect b/bin/dwibiascorrect index bccdfeefe7..acd81b86dc 100755 --- a/bin/dwibiascorrect +++ b/bin/dwibiascorrect @@ -108,7 +108,7 @@ elif app.args.ants: run.command('mrconvert mean_bzero.mif mean_bzero.nii -stride +1,+2,+3') run.command('mrconvert mask.mif mask.nii -stride +1,+2,+3') bias_path = 'bias.nii' - run.command('N4BiasFieldCorrection -d 3 -i mean_bzero.nii -w mask.nii -o [corrected.nii,' + bias_path + '] -b [150,3] -c [1000x1000,0.0]') + run.command('N4BiasFieldCorrection -d 3 -i mean_bzero.nii -w mask.nii -o [corrected.nii,' + bias_path + '] -s 4 -b [100,3] -c [1000,0.0]') run.command('mrcalc in.mif ' + bias_path + ' -div result.mif') run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + (' -force' if app.forceOverwrite else '')) From c66680d9a100a3c7d8a13da6c39be7784cfd73e7 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Sat, 30 Sep 2017 22:43:16 +1000 Subject: [PATCH 165/538] dwipreproc: Initial work toward -align_seepi option Take the solution for achieving alignment between the inhomogeneity field estimated by topup and the corrections applied by eddy, which is unfortunately not applicable in all scenarios, and turn it into a command-line option. Solution is not yet tested. image.match(): Add option for maximum dimension to test. Grab some extra DICOM fields that may prove useful. --- bin/dwipreproc | 300 ++++++++++++++++++++++--------------- core/file/dicom/image.cpp | 194 +++++++++++++----------- core/file/dicom/image.h | 32 ++-- core/file/dicom/mapper.cpp | 56 ++++--- lib/mrtrix3/image.py | 21 ++- 5 files changed, 353 insertions(+), 250 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 5d9174f9cc..a297aef6a0 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -50,6 +50,7 @@ options = app.cmdline.add_argument_group('Other options for the dwipreproc scrip options.add_argument('-pe_dir', metavar=('PE'), help='Manually specify the phase encoding direction of the input series; can be a signed axis number (e.g. -0, 1, +2), an axis designator (e.g. RL, PA, IS), or NIfTI axis codes (e.g. i-, j, k)') options.add_argument('-readout_time', metavar=('time'), type=float, help='Manually specify the total readout time of the input series (in seconds)') options.add_argument('-se_epi', metavar=('file'), help='Provide an additional image series consisting of spin-echo EPI images, which is to be used exclusively by topup for estimating the inhomogeneity field (i.e. it will not form part of the output image series)') +options.add_argument('-align_seepi', action='store_true', help='Achieve alignment between the SE-EPI images used for inhomogeneity field estimation, and the DWIs, by inserting the first DWI b=0 volume to the SE-EPI series. Only use this option if the input SE-EPI images have identical image contrast to the b=0 images present in the DWI series.') options.add_argument('-json_import', metavar=('JSON_file'), help='Import image header information from an associated JSON file (may be necessary to determine phase encoding information)') options.add_argument('-topup_options', metavar=('TopupOptions'), help='Manually provide additional command-line options to the topup command (provide a string within quotation marks that contains at least one space, even if only passing a single command-line option to topup)') options.add_argument('-eddy_options', metavar=('EddyOptions'), help='Manually provide additional command-line options to the eddy command (provide a string within quotation marks that contains at least one space, even if only passing a single command-line option to eddy)') @@ -312,8 +313,17 @@ overwrite_topup_pe_scheme = False topup_in_path = 'topup_in.mif' dwi_permute_volumes_pre_eddy_option = '' dwi_permute_volumes_post_eddy_option = '' +dwi_bzero_added_to_topup = False if app.args.se_epi: + # Newest version of eddy requires that topup field be on the same grid as the eddy input DWI + if not image.match('dwi.mif', 'topup_in.mif', 3): + app.console('DWIs and SE-EPI images used for inhomogeneity field estimation are defined on different image grids; ' + 'the latter will be automatically re-gridded to match the former') + run.command('mrtransform ' + topup_in_path + ' - -interp sinc -template dwi.mif | mrcalc - 0.0 -max topup_in_regrid.mif') + file.delTempFile(topup_in_path) + topup_in_path = 'topup_in_regrid.mif' + # 3 possible sources of PE information: DWI header, topup image header, command-line # Any pair of these may conflict, and any one could be absent @@ -353,7 +363,7 @@ if app.args.se_epi: # - Don't have enough information to proceed # - Is this too harsh? (e.g. Have rules by which it may be inferred from the DWI header / command-line) if not topup_pe_scheme: - app.error('If explicitly including SE EPI images when using -rpe_all option, they must come with their own associated phase-encoding information') + app.error('If explicitly including SE EPI images when using -rpe_all option, they must come with their own associated phase-encoding information in the image header') elif PE_design == 'Header': # Criteria: @@ -362,106 +372,135 @@ if app.args.se_epi: # * If _not_ present in own header: # Cannot proceed if not topup_pe_scheme: - app.error('No phase-encoding information present in SE EPI image header'); - - # If we are using the -se_epi option, and hence the input images to topup have not come from the DWIs themselves, - # we need to insert the first b=0 DWI volume to the start of the topup input image. Otherwise, the field estimated - # by topup will not be correctly aligned with the volumes as they are processed by eddy. - bzero_threshold = 10.0 - if 'BZeroThreshold' in app.config: - bzero_threshold = float(app.config['BZeroThreshold']) - dwi_first_bzero_index = 0 - for line in grad: - if line[3] <= bzero_threshold: - break - dwi_first_bzero_index += 1 - if dwi_first_bzero_index == len(grad): - app.warn('Unable to find b=0 volume in input DWIs to provide alignment between topup and eddy; script will proceed on the assumption that motion between the SE-EPI and DWI series is negligible. Note however that eddy itself may crash in this scenario.') - else: - run.command('mrconvert dwi.mif dwi_first_bzero.mif -coord 3 ' + str(dwi_first_bzero_index) + ' -axes 0,1,2') - dwi_first_bzero_pe = dwi_manual_pe_scheme[dwi_first_bzero_index] if overwrite_dwi_pe_scheme else dwi_pe_scheme[dwi_first_bzero_index] - - dwi_te = image.headerKeyValue('dwi.mif', 'EchoTime') - fmap_te = image.headerKeyValue(topup_in_path, 'EchoTime') - if dwi_te and fmap_te and not dwi_te == fmap_te: - app.warn('It appears that the spin-echo EPI images used for inhomogeneity field estimation have a different echo time to the DWIs being corrected. ' - 'This may cause issues in estimation of the field, as the first DWI b=0 volume must be additionally used as input to topup for alignment purposes. ' - 'SE-EPI images with different contrast to the DWI b=0 images is not yet supported by dwipreproc.') - - # Don't need to use image.match() here; only require that the dimensions of the first three axes, and - # the first three voxel sizes, to be equivalent - dwi_vox = [ float(f) for f in image.headerField('dwi.mif', 'vox').strip().split() ] - topup_vox = [ float(f) for f in image.headerField(topup_in_path, 'vox').strip().split() ] - fmap_needs_regrid = not (dwi_size[0:3] == topup_size[0:3] and dwi_vox[0:3] == topup_vox[0:3]) - if fmap_needs_regrid: - app.warn('DWIs and SE-EPI images used for inhomogeneity field estimation are defined on different image grids; ' - 'The latter will be automatically re-gridded to match the former to facilitate spatial alignment ' - 'between topup and eddy stages') - - topup_pe_sum = [ 0, 0, 0 ] - topup_volume_to_remove = len(topup_pe_scheme) - for index, line in enumerate(topup_pe_scheme): - topup_pe_sum = [ i + j for i, j in zip(topup_pe_sum, line[0:3]) ] - if topup_volume_to_remove == len(topup_pe_scheme) and line[0:3] == dwi_first_bzero_pe[0:3]: - topup_volume_to_remove = index - if (topup_pe_sum == [ 0, 0, 0 ]) and (topup_volume_to_remove < len(topup_pe_scheme)): - app.console('Balanced phase-encoding scheme detected in \'' + app.args.se_epi + '\'; volume ' + str(topup_volume_to_remove) + ' will be removed and replaced with first b=0 from DWIs') - if fmap_needs_regrid: - run.command('mrconvert ' + topup_in_path + ' - -coord 3 ' + ','.join([str(index) for index in range(len(topup_pe_scheme)) if not index == topup_volume_to_remove]) + ' | mrtransform - - -interp sinc -template dwi_first_bzero.mif | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') + app.error('No phase-encoding information present in SE EPI image header') + # If there is no phase encoding contrast within the SE-EPI series, + # try combining it with the DWI b=0 volumes, see if that produces some contrast + # However, this should probably only be permitted if the -align_seepi option is defined + topup_pe_scheme_has_contrast = bool(image.headerKeyValue(topup_in_path, 'pe_scheme')) + if not topup_pe_scheme_has_contrast: + if app.args.align_seepi: + app.console('No phase-encoding contrast present in SE-EPI images; will examine again after combining with DWI b=0 images') + run.command('dwiextract dwi.mif - -bzero | mrcat - topup_in.mif topup_in_dwibzero.mif -axis 3') + new_topup_in_path = os.path.splitext(topup_in_path)[0] + '_dwibzero.mif' + topup_pe_scheme_has_contrast = bool(image.headerKeyValue(new_topup_in_path, 'pe_scheme')) + if topup_pe_scheme_has_contrast: + file.delTempFile(topup_in_path) + topup_in_path = new_topup_in_path + topup_pe_scheme = phaseEncoding.getScheme(topup_in_path) + dwi_bzero_added_to_topup = True + else: + app.error('No phase-encoding contrast present in SE-EPI images, even after concatenating with b=0 images; ' + 'cannot perform inhomogeneity field estimation') else: - run.command('mrconvert ' + topup_in_path + ' - -coord 3 ' + ','.join([str(index) for index in range(len(topup_pe_scheme)) if not index == topup_volume_to_remove]) + ' | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') - file.delTempFile(topup_in_path) - # Also need to update the phase-encoding scheme appropriately if it's being set manually - # (if embedded within the image headers, should be updated through the command calls) - if topup_manual_pe_scheme: - first_line = list(manual_pe_dir) - first_line.append(trt) - new_topup_manual_pe_scheme = [ ] - new_topup_manual_pe_scheme.append(first_line) - for index, entry in enumerate(topup_manual_pe_scheme): - if not index == topup_volume_to_remove: - new_topup_manual_pe_scheme.append(entry) - topup_manual_pe_scheme = new_topup_manual_pe_scheme + app.error('No phase-encoding contrast present in SE-EPI images; cannot perform inhomogeneity field estimation') + + if app.args.align_seepi: + + # If we are using the -se_epi option, and hence the input images to topup have not come from the DWIs themselves, + # we need to insert the first b=0 DWI volume to the start of the topup input image. Otherwise, the field estimated + # by topup will not be correctly aligned with the volumes as they are processed by eddy. + bzero_threshold = 10.0 + if 'BZeroThreshold' in app.config: + bzero_threshold = float(app.config['BZeroThreshold']) + dwi_first_bzero_index = 0 + for line in grad: + if line[3] <= bzero_threshold: + break + dwi_first_bzero_index += 1 + if dwi_first_bzero_index == len(grad): + app.warn('Unable to find b=0 volume in input DWIs to provide alignment between topup and eddy; script will proceed as though the -align_seepi option were not provided') else: - if topup_pe_sum == [ 0, 0, 0 ] and topup_volume_to_remove == len(topup_pe_scheme): - app.console('Phase-encoding scheme of -se_epi image is balanced, but could not find appropriate volume with which to substitute first b=0 volume from DWIs; first b=0 DWI volume will be inserted to start of series') - else: - app.console('Unbalanced phase-encoding scheme detected in series provided via -se_epi option; first DWI b=0 volume will be inserted to start of series') - if fmap_needs_regrid: - run.command('mrtransform ' + topup_in_path + ' - -interp sinc -template dwi_first_bzero.mif | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') - else: - run.command('mrcat dwi_first_bzero.mif ' + topup_in_path + ' topup_in_dwibzero.mif -axis 3') - file.delTempFile(topup_in_path) - # Also need to update the phase-encoding scheme appropriately - if topup_manual_pe_scheme: - first_line = list(manual_pe_dir) - first_line.append(trt) - topup_manual_pe_scheme = [ first_line, topup_manual_pe_scheme ] - - # Ended branching based on balanced-ness of PE acquisition scheme within SE-EPI volumes - topup_in_path = 'topup_in_dwibzero.mif' - - # If the first b=0 volume in the DWIs is in fact not the volume (i.e. index zero), we're going to - # manually place it at the start of the DWI volumes when they are input to eddy, so that the - # first input volume to topup and the first input volume to eddy are one and the same. - # Note: If at a later date, the statistical outputs from eddy are considered (e.g. motion, outliers), - # then this volume permutation will need to be taken into account - if dwi_first_bzero_index: - app.console('First b=0 volume in input DWIs is volume index ' + str(dwi_first_bzero_index) + '; ' - 'this will be permuted to be the first volume (index 0) when eddy is run') - dwi_permute_volumes_pre_eddy_option = ' -coord 3 ' + \ - str(dwi_first_bzero_index) + \ - ',0' + \ - (':' + str(dwi_first_bzero_index-1) if dwi_first_bzero_index > 1 else '') + \ - (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < num_volumes-1 else '') + \ - (':' + str(num_volumes-1) if dwi_first_bzero_index < num_volumes-2 else '') - dwi_permute_volumes_post_eddy_option = ' -coord 3 1' + \ - (':' + str(dwi_first_bzero_index) if dwi_first_bzero_index > 1 else '') + \ - ',0' + \ - (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < num_volumes-1 else '') + \ - (':' + str(num_volumes-1) if dwi_first_bzero_index < num_volumes-2 else '') - - # Completed checking for presence of b=0 image in DWIs + run.command('mrconvert dwi.mif dwi_first_bzero.mif -coord 3 ' + str(dwi_first_bzero_index) + ' -axes 0,1,2') + dwi_first_bzero_pe = dwi_manual_pe_scheme[dwi_first_bzero_index] if overwrite_dwi_pe_scheme else dwi_pe_scheme[dwi_first_bzero_index] + + dwi_te = image.headerKeyValue('dwi.mif', 'EchoTime') + fmap_te = image.headerKeyValue(topup_in_path, 'EchoTime') + if dwi_te and fmap_te and not dwi_te == fmap_te: + app.warn('It appears that the spin-echo EPI images used for inhomogeneity field estimation have a different echo time to the DWIs being corrected. ' + 'This may cause issues in estimation of the field, as the first DWI b=0 volume will be added to the input series to topup ' + 'due to use of the -align_seepi option.') + + dwi_tr = image.headerKeyValue('dwi.mif', 'RepetitionTime') + fmap_tr = image.headerKeyValue(topup_in_path, 'RepetitionTime') + if dwi_tr and fmap_tr and not dwi_tr == fmap_tr: + app.warn('It appears that the spin-echo EPI images used for inhomogeneity field estimation have a different repetition time to the DWIs being corrected. ' + 'This may cause issues in estimation of the field, as the first DWI b=0 volume will be added to the input series to topup ' + 'due to use of the -align_seepi option.') + + dwi_flip = image.headerKeyValue('dwi.mif', 'FlipAngle') + fmap_flip = image.headerKeyValue(topup_in_path, 'FlipAngle') + if dwi_flip and fmap_flip and not dwi_flip == fmap_flip: + app.warn('It appears that the spin-echo EPI images used for inhomogeneity field estimation have a different flip angle to the DWIs being corrected. ' + 'This may cause issues in estimation of the field, as the first DWI b=0 volume will be added to the input series to topup ' + 'due to use of the -align_seepi option.') + + # If we have already apliced the b=0 volumes from the DWI input with the SE-EPI image + # (due to the absence of phase-encoding contrast in the SE-EPI series), we don't want to + # re-attempt such a concatenation; the fact that the DWI b=0 images were inserted ahead of + # the SE-EPI images means the alignment issue should be dealt with. + # Note however that in this instance it may still be necessary to permute the volumes within the + # DWI series if the first volume is not a b=0 volume; but the first b=0 volume will inherently + # already be the first volume in the input to topup + if not dwi_bzero_added_to_topup: + topup_pe_sum = [ 0, 0, 0 ] + topup_volume_to_remove = len(topup_pe_scheme) + for index, line in enumerate(topup_pe_scheme): + topup_pe_sum = [ i + j for i, j in zip(topup_pe_sum, line[0:3]) ] + if topup_volume_to_remove == len(topup_pe_scheme) and line[0:3] == dwi_first_bzero_pe[0:3]: + topup_volume_to_remove = index + if (topup_pe_sum == [ 0, 0, 0 ]) and (topup_volume_to_remove < len(topup_pe_scheme)): + app.console('Balanced phase-encoding scheme detected in \'' + app.args.se_epi + '\'; volume ' + str(topup_volume_to_remove) + ' will be removed and replaced with first b=0 from DWIs') + run.command('mrconvert ' + topup_in_path + ' - -coord 3 ' + ','.join([str(index) for index in range(len(topup_pe_scheme)) if not index == topup_volume_to_remove]) + ' | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') + # Also need to update the phase-encoding scheme appropriately if it's being set manually + # (if embedded within the image headers, should be updated through the command calls) + if topup_manual_pe_scheme: + first_line = list(manual_pe_dir) + first_line.append(trt) + new_topup_manual_pe_scheme = [ ] + new_topup_manual_pe_scheme.append(first_line) + for index, entry in enumerate(topup_manual_pe_scheme): + if not index == topup_volume_to_remove: + new_topup_manual_pe_scheme.append(entry) + topup_manual_pe_scheme = new_topup_manual_pe_scheme + else: + if topup_pe_sum == [ 0, 0, 0 ] and topup_volume_to_remove == len(topup_pe_scheme): + app.console('Phase-encoding scheme of -se_epi image is balanced, but could not find appropriate volume with which to substitute first b=0 volume from DWIs; first b=0 DWI volume will be inserted to start of series, resulting in an unbalanced scheme') + else: + app.console('Unbalanced phase-encoding scheme detected in series provided via -se_epi option; first DWI b=0 volume will be inserted to start of series') + run.command('mrcat dwi_first_bzero.mif ' + topup_in_path + ' topup_in_dwibzero.mif -axis 3') + # Also need to update the phase-encoding scheme appropriately + if topup_manual_pe_scheme: + first_line = list(manual_pe_dir) + first_line.append(trt) + topup_manual_pe_scheme = [ first_line, topup_manual_pe_scheme ] + + # Ended branching based on balanced-ness of PE acquisition scheme within SE-EPI volumes + file.delTempFile(topup_in_path) + topup_in_path = 'topup_in_dwibzero.mif' + + # Ended branching based on prior merge of SE-EPI and DWI b=0 volumes due to no phase-encoding contrast in SE-EPI + + # If the first b=0 volume in the DWIs is in fact not the volume (i.e. index zero), we're going to + # manually place it at the start of the DWI volumes when they are input to eddy, so that the + # first input volume to topup and the first input volume to eddy are one and the same. + # Note: If at a later date, the statistical outputs from eddy are considered (e.g. motion, outliers), + # then this volume permutation will need to be taken into account + if dwi_first_bzero_index: + app.console('First b=0 volume in input DWIs is volume index ' + str(dwi_first_bzero_index) + '; ' + 'this will be permuted to be the first volume (index 0) when eddy is run') + dwi_permute_volumes_pre_eddy_option = ' -coord 3 ' + \ + str(dwi_first_bzero_index) + \ + ',0' + \ + (':' + str(dwi_first_bzero_index-1) if dwi_first_bzero_index > 1 else '') + \ + (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < num_volumes-1 else '') + \ + (':' + str(num_volumes-1) if dwi_first_bzero_index < num_volumes-2 else '') + dwi_permute_volumes_post_eddy_option = ' -coord 3 1' + \ + (':' + str(dwi_first_bzero_index) if dwi_first_bzero_index > 1 else '') + \ + ',0' + \ + (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < num_volumes-1 else '') + \ + (':' + str(num_volumes-1) if dwi_first_bzero_index < num_volumes-2 else '') + + # Completed checking for presence of b=0 image in DWIs elif not PE_design == 'None': # No SE EPI images explicitly provided: In some cases, can extract appropriate b=0 images from DWI @@ -503,21 +542,38 @@ run.command('mrinfo dwi.mif -export_grad_mrtrix grad.b') eddy_in_topup_option = '' +dwi_post_eddy_crop_option = '' +dwi_padded = 'dwi.mif' if do_topup: - # If no axes need to be cropped, use the original topup input volumes - # Otherwise, need to call mrcrop with the appropriate options, and pass those to topup - # For any non-even axis sizes, crop the first voxel along that dimension - # TODO This primarily applies to topup - don't recall if eddy bugs out or not - crop_option = '' - for axis, axis_size in enumerate(topup_size[:3]): - if int(axis_size)%2: - crop_option += ' -axis ' + str(axis) + ' 1 ' + str(int(axis_size)-1) - if crop_option: - app.warn('Topup images contain at least one non-even dimension; cropping images for topup compatibility') - run.command('mrcrop ' + topup_in_path + ' topup_in_crop.mif' + crop_option) - file.delTempFile(topup_in_path) - topup_in_path = 'topup_in_crop.mif' + # topup will crash if its input image has a spatial dimension with a non-even size; + # presumably due to a downsampling by a factor of 2 in a multi-resolution scheme + # The newest eddy also requires the output from topup and the input DWIs to have the same size; + # therefore this restriction applies to the DWIs as well + # Rather than crop in this case (which would result in a cropped output image), + # duplicate the last slice on any problematic axis, and then crop that extra + # slice at the output step + # By this point, if the SE-EPI images and DWIs are not on the same image grid, the + # SE-EPI images have already been re-gridded to DWI image space; + # therefore 'topup_size' is out of date, and we need to test 'dwi_size' + odd_axis_count = 0 + for axis_size in dwi_size[:3]: + if int(axis_size%2): + odd_axis_count += 1 + if odd_axis_count: + app.console(str(odd_axis_count) + ' spatial ' + ('axes' if odd_axis_count > 1 else 'axis') + ' of DWIs have non-even size; ' + 'this will be automatically padded for compatibility with topup, and the extra slice' + ('s' if odd_axis_count > 1 else '') + ' erased afterwards') + for axis, axis_size in enumerate(dwi_size[:3]): + if int(axis_size%2): + new_topup_in_path = os.path.splitext(topup_in_path)[0] + '_pad' + str(axis) + '.mif' + run.command('mrconvert ' + topup_in_path + ' -coord ' + str(axis) + ' ' + str(axis_size-1) + ' - | mrcat ' + topup_in_path + ' - ' + new_topup_in_path + ' -axis ' + str(axis)) + file.delTempFile(topup_in_path) + topup_in_path = new_topup_in_path + new_dwi_padded = os.path.splitext(dwi_padded)[0] + '_pad' + str(axis) + '.mif' + run.command('mrconvert ' + dwi_padded + ' -coord ' + str(axis) + ' ' + str(axis_size-1) + ' - | mrcat ' + dwi_padded + ' - ' + new_dwi_padded + ' - axis ' + str(axis)) + file.delTempFile(dwi_padded) + dwi_padded = new_dwi_padded + dwi_post_eddy_crop_option += ' -coord ' + str(axis) + ' 0:' + str(axis_size-1) # Do the conversion in preparation for topup run.command('mrconvert ' + topup_in_path + ' topup_in.nii' + import_topup_pe_table_option + ' -stride -1,+2,+3,+4 -export_pe_table topup_datain.txt') @@ -533,9 +589,9 @@ if do_topup: # applytopup can't receive the complete DWI input and correct it as a whole, because the phase-encoding # details may vary between volumes if dwi_manual_pe_scheme: - run.command('mrconvert dwi.mif' + import_dwi_pe_table_option + ' - | mrinfo - -export_pe_eddy applytopup_config.txt applytopup_indices.txt') + run.command('mrconvert ' + dwi_padded + import_dwi_pe_table_option + ' - | mrinfo - -export_pe_eddy applytopup_config.txt applytopup_indices.txt') else: - run.command('mrinfo dwi.mif -export_pe_eddy applytopup_config.txt applytopup_indices.txt') + run.command('mrinfo ' + dwi_padded + ' -export_pe_eddy applytopup_config.txt applytopup_indices.txt') applytopup_index_list = [ ] applytopup_image_list = [ ] @@ -543,7 +599,7 @@ if do_topup: with open('applytopup_config.txt', 'r') as f: for line in f: image_path = 'dwi_pe_' + str(index) + '.nii' - run.command('dwiextract dwi.mif' + import_dwi_pe_table_option + ' -pe ' + ','.join(line.split()) + ' ' + image_path) + run.command('dwiextract ' + dwi_padded + import_dwi_pe_table_option + ' -pe ' + ','.join(line.split()) + ' ' + image_path) applytopup_index_list.append(str(index)) applytopup_image_list.append(image_path) index += 1 @@ -559,13 +615,13 @@ if do_topup: else: # Generate a processing mask for eddy based on the uncorrected input DWIs - run.command('dwi2mask dwi.mif - | maskfilter - dilate - | mrconvert - mask.nii -datatype float32 -stride -1,+2,+3') + run.command('dwi2mask ' + dwi_padded + ' - | maskfilter - dilate - | mrconvert - mask.nii -datatype float32 -stride -1,+2,+3') # Run eddy -run.command('mrconvert dwi.mif' + import_dwi_pe_table_option + dwi_permute_volumes_pre_eddy_option + ' dwi.nii -stride -1,+2,+3,+4 -export_grad_fsl bvecs bvals -export_pe_eddy eddy_config.txt eddy_indices.txt') -file.delTempFile('dwi.mif') +run.command('mrconvert ' + dwi_padded + import_dwi_pe_table_option + dwi_permute_volumes_pre_eddy_option + ' dwi.nii -stride -1,+2,+3,+4 -export_grad_fsl bvecs bvals -export_pe_eddy eddy_config.txt eddy_indices.txt') +file.delTempFile(dwi_padded) eddy_manual_options = '' if app.args.eddy_options: eddy_manual_options = ' ' + app.args.eddy_options.strip() @@ -608,7 +664,7 @@ for index1 in range(num_volumes): if not len(volume_pairs) == num_volumes/2: # Convert the resulting volume to the output image, and re-insert the diffusion encoding - run.command('mrconvert dwi_post_eddy' + fsl_suffix + ' result.mif' + dwi_permute_volumes_post_eddy_option + stride_option + ' -fslgrad ' + bvecs_path + ' bvals') + run.command('mrconvert dwi_post_eddy' + fsl_suffix + ' result.mif' + dwi_permute_volumes_post_eddy_option + dwi_post_eddy_crop_option + stride_option + ' -fslgrad ' + bvecs_path + ' bvals') else: app.console('Detected matching DWI volumes with opposing phase encoding; performing explicit volume recombination') @@ -724,15 +780,15 @@ else: file.delTempFile('weight' + str(index+1) + '.mif') # Finally the recombined volumes must be concatenated to produce the resulting image series - run.command('mrcat ' + ' '.join(combined_image_list) + ' - -axis 3 | mrconvert - result.mif -fslgrad bvecs_combined bvals_combined' + stride_option) + run.command('mrcat ' + ' '.join(combined_image_list) + ' - -axis 3 | mrconvert - result.mif' + dwi_post_eddy_crop_option + ' -fslgrad bvecs_combined bvals_combined' + stride_option) for entry in combined_image_list: file.delTempFile(entry) - +# TODO Should header key-values only in place for the purposes of pre-processing (i.e. TE, TR, flip angle, in-plane acceleration) be erased? # Finish! -run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + grad_export_option + (' -force' if app.force else '')) +run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True)+ grad_export_option + (' -force' if app.force else '')) app.complete() diff --git a/core/file/dicom/image.cpp b/core/file/dicom/image.cpp index e3b4929fdf..43eecad5fc 100644 --- a/core/file/dicom/image.cpp +++ b/core/file/dicom/image.cpp @@ -33,7 +33,7 @@ namespace MR { if (item.parents[n].group == 0x5200U && ( item.parents[n].element == 0x9230U || // per-frame tag item.parents[n].element == 0x9229U)) { // shared across frames tag - is_toplevel = true; + is_toplevel = true; break; } } @@ -43,41 +43,45 @@ namespace MR { // process image-specific or per-frame items here: if (is_toplevel) { switch (item.group) { - case 0x0018U: + case 0x0018U: switch (item.element) { - case 0x0050U: - slice_thickness = item.get_float()[0]; - return; - case 0x0088U: - slice_spacing = item.get_float()[0]; - return; - case 0x1310U: - acq_dim[0] = std::max (item.get_uint()[0], item.get_uint()[1]); - acq_dim[1] = std::max (item.get_uint()[2], item.get_uint()[3]); - if (item.get_uint()[0] == 0 && item.get_uint()[3] == 0) - std::swap (acq_dim[0], acq_dim[1]); - return; - case 0x0024U: + case 0x0024U: sequence_name = item.get_string()[0]; if (!sequence_name.size()) return; - { + { int c = sequence_name.size()-1; if (!isdigit (sequence_name[c])) return; - while (c >= 0 && isdigit (sequence_name[c])) + while (c >= 0 && isdigit (sequence_name[c])) --c; ++c; sequence = to (sequence_name.substr (c)); } return; - case 0x9087U: - bvalue = item.get_float()[0]; + case 0x0050U: + slice_thickness = item.get_float()[0]; return; - case 0x9089U: - G[0] = item.get_float()[0]; - G[1] = item.get_float()[1]; - G[2] = item.get_float()[2]; + case 0x0080U: + repetition_time = item.get_float()[0]; + return; + case 0x0081U: + echo_time = item.get_float()[0]; + return; + case 0x0088U: + slice_spacing = item.get_float()[0]; + return; + case 0x0091U: + echo_train_length = item.get_int()[0]; + return; + case 0x0095U: + pixel_bandwidth = item.get_float()[0]; + return; + case 0x1310U: + acq_dim[0] = std::max (item.get_uint()[0], item.get_uint()[1]); + acq_dim[1] = std::max (item.get_uint()[2], item.get_uint()[3]); + if (item.get_uint()[0] == 0 && item.get_uint()[3] == 0) + std::swap (acq_dim[0], acq_dim[1]); return; case 0x1312U: if (item.get_string()[0] == "ROW") @@ -85,27 +89,45 @@ namespace MR { else if (item.get_string()[0] == "COL") pe_axis = 1; return; - case 0x0095U: - pixel_bandwidth = item.get_float()[0]; + case 0x1314U: + flip_angle = item.get_float()[0]; return; - case 0x0081U: - echo_time = item.get_float()[0]; + case 0x9036U: + if (item.get_string()[0] == "PHASE") + partial_fourier_axis = 0; + else if (item.get_string()[0] == "FREQUENCY") + partial_fourier_axis = 1; + else if (item.get_string()[0] == "SLICE_SELECT") + partial_fourier_axis = 2; + else if (item.get_string()[0] == "COMBINATION") + partial_fourier_axis = -2; return; - case 0x0091: - echo_train_length = item.get_int()[0]; + case 0x9069U: + parallel_inplane_factor = item.get_int()[0]; + return; + case 0x9087U: + bvalue = item.get_float()[0]; + return; + case 0x9089U: + G[0] = item.get_float()[0]; + G[1] = item.get_float()[1]; + G[2] = item.get_float()[2]; + return; + case 0x9081U: + partial_fourier_fraction = item.get_float()[0]; return; } return; - case 0x0020U: + case 0x0020U: switch (item.element) { - case 0x0011U: - series_num = item.get_uint()[0]; + case 0x0011U: + series_num = item.get_uint()[0]; return; case 0x0012U: - acq = item.get_uint()[0]; + acq = item.get_uint()[0]; return; - case 0x0013U: - instance = item.get_uint()[0]; + case 0x0013U: + instance = item.get_uint()[0]; return; case 0x0032U: position_vector[0] = item.get_float()[0]; @@ -122,7 +144,7 @@ namespace MR { orientation_x.normalize(); orientation_y.normalize(); return; - case 0x9157U: + case 0x9157U: index = item.get_uint(); if (frame_dim.size() < index.size()) frame_dim.resize (index.size()); @@ -134,28 +156,28 @@ namespace MR { return; case 0x0028U: switch (item.element) { - case 0x0010U: - dim[1] = item.get_uint()[0]; + case 0x0010U: + dim[1] = item.get_uint()[0]; return; case 0x0011U: - dim[0] = item.get_uint()[0]; + dim[0] = item.get_uint()[0]; return; case 0x0030U: pixel_size[0] = item.get_float()[0]; - pixel_size[1] = item.get_float()[1]; + pixel_size[1] = item.get_float()[1]; return; - case 0x0100U: - bits_alloc = item.get_uint()[0]; + case 0x0100U: + bits_alloc = item.get_uint()[0]; return; case 0x1052U: - scale_intercept = item.get_float()[0]; + scale_intercept = item.get_float()[0]; return; case 0x1053U: - scale_slope = item.get_float()[0]; + scale_slope = item.get_float()[0]; return; } return; - case 0xFFFEU: + case 0xFFFEU: switch (item.element) { case 0xE000U: if (item.parents.size() && @@ -166,13 +188,13 @@ namespace MR { frames.push_back (std::shared_ptr (new Frame (*this))); frame_offset += dim[0] * dim[1] * (bits_alloc/8); } - else + else in_frames = true; } return; } return; - case 0x7FE0U: + case 0x7FE0U: if (item.element == 0x0010U) { data = item.offset (item.data); data_size = item.size; @@ -191,29 +213,29 @@ namespace MR { // process more non-specific stuff here: switch (item.group) { - case 0x0008U: - if (item.element == 0x0070U) + case 0x0008U: + if (item.element == 0x0070U) manufacturer = item.get_string()[0]; return; - case 0x0019U: + case 0x0019U: switch (item.element) { // GE DW encoding info: case 0x10BBU: - if (item.get_float().size()) - G[0] = item.get_float()[0]; + if (item.get_float().size()) + G[0] = item.get_float()[0]; return; case 0x10BCU: - if (item.get_float().size()) - G[1] = item.get_float()[0]; + if (item.get_float().size()) + G[1] = item.get_float()[0]; return; case 0x10BDU: - if (item.get_float().size()) - G[2] = item.get_float()[0]; + if (item.get_float().size()) + G[2] = item.get_float()[0]; return; case 0x100CU: //Siemens private DW encoding tags: - if (item.get_float().size()) - bvalue = item.get_float()[0]; + if (item.get_float().size()) + bvalue = item.get_float()[0]; return; - case 0x100EU: + case 0x100EU: if (item.get_float().size() == 3) { G[0] = item.get_float()[0]; G[1] = item.get_float()[1]; @@ -229,30 +251,30 @@ namespace MR { } return; case 0x0029U: // Siemens CSA entry - if (item.element == 0x1010U || item.element == 0x1020U) + if (item.element == 0x1010U || item.element == 0x1020U) decode_csa (item.data, item.data + item.size); return; case 0x0043U: // GEMS_PARMS_01 block if (item.element == 0x1039U) { - if (item.get_int().size()) + if (item.get_int().size()) bvalue = item.get_int()[0]; DW_scheme_wrt_image = true; } return; - case 0x2001U: // Philips DW encoding info: - if (item.element == 0x1003) + case 0x2001U: // Philips DW encoding info: + if (item.element == 0x1003) bvalue = item.get_float()[0]; return; - case 0x2005U: // Philips DW encoding info: + case 0x2005U: // Philips DW encoding info: switch (item.element) { - case 0x10B0U: - G[0] = item.get_float()[0]; + case 0x10B0U: + G[0] = item.get_float()[0]; return; case 0x10B1U: - G[1] = item.get_float()[0]; + G[1] = item.get_float()[0]; return; case 0x10B2U: - G[2] = item.get_float()[0]; + G[2] = item.get_float()[0]; return; } return; @@ -271,7 +293,7 @@ namespace MR { Element item; item.set (filename); - while (item.read()) + while (item.read()) parse_item (item); calc_distance(); @@ -279,7 +301,7 @@ namespace MR { if (frame_offset > 0) frames.push_back (std::shared_ptr (new Frame (*this))); - for (size_t n = 0; n < frames.size(); ++n) + for (size_t n = 0; n < frames.size(); ++n) frames[n]->data = data + frames[n]->frame_offset; } @@ -296,13 +318,13 @@ namespace MR { CSAEntry entry (start, end); while (entry.parse()) { - if (strcmp ("B_value", entry.key()) == 0) + if (strcmp ("B_value", entry.key()) == 0) bvalue = entry.get_float(); - else if (strcmp ("DiffusionGradientDirection", entry.key()) == 0) + else if (strcmp ("DiffusionGradientDirection", entry.key()) == 0) entry.get_float (G); - else if (strcmp ("NumberOfImagesInMosaic", entry.key()) == 0) + else if (strcmp ("NumberOfImagesInMosaic", entry.key()) == 0) images_in_mosaic = entry.get_int(); - else if (strcmp ("SliceNormalVector", entry.key()) == 0) + else if (strcmp ("SliceNormalVector", entry.key()) == 0) entry.get_float (orientation_z); else if (strcmp ("PhaseEncodingDirectionPositive", entry.key()) == 0) pe_sign = (entry.get_int() > 0) ? 1 : -1; @@ -320,12 +342,12 @@ namespace MR { std::ostream& operator<< (std::ostream& stream, const Frame& item) { - stream << ( item.instance == UINT_MAX ? 0 : item.instance ) << "#" + stream << ( item.instance == UINT_MAX ? 0 : item.instance ) << "#" << ( item.acq == UINT_MAX ? 0 : item.acq) << ":" - << ( item.sequence == UINT_MAX ? 0 : item.sequence ) << " " + << ( item.sequence == UINT_MAX ? 0 : item.sequence ) << " " << item.dim[0] << "x" << item.dim[1] << ", " - << item.pixel_size[0] << "x" << item.pixel_size[1] << " x " - << item.slice_thickness << " (" << item.slice_spacing << ") mm, z = " << item.distance + << item.pixel_size[0] << "x" << item.pixel_size[1] << " x " + << item.slice_thickness << " (" << item.slice_spacing << ") mm, z = " << item.distance << ( item.index.size() ? ", index = " + str(item.index) : std::string() ) << ", [ " << item.position_vector[0] << " " << item.position_vector[1] << " " << item.position_vector[2] << " ] [ " << item.orientation_x[0] << " " << item.orientation_x[1] << " " << item.orientation_x[2] << " ] [ " @@ -345,15 +367,15 @@ namespace MR { std::ostream& operator<< (std::ostream& stream, const Image& item) { - stream << ( item.filename.size() ? item.filename : "file not set" ) << ":\n" - << ( item.sequence_name.size() ? item.sequence_name : "sequence not set" ) << " [" + stream << ( item.filename.size() ? item.filename : "file not set" ) << ":\n" + << ( item.sequence_name.size() ? item.sequence_name : "sequence not set" ) << " [" << (item.manufacturer.size() ? item.manufacturer : std::string("unknown manufacturer")) << "] " << (item.frames.size() > 0 ? str(item.frames.size()) + " frames with dim " + str(item.frame_dim) : std::string()); if (item.frames.size()) { for (size_t n = 0; n < item.frames.size(); ++n) stream << " " << static_cast(*item.frames[n]) << "\n"; } - else + else stream << " " << static_cast(item) << "\n"; return stream; @@ -390,11 +412,11 @@ namespace MR { const Frame& frame (**frame_it); if (frame.series_num != previous->series_num || - frame.acq != previous->acq) + frame.acq != previous->acq) update_count (2, dim, index); - else if (frame.distance != previous->distance) + else if (frame.distance != previous->distance) update_count (1, dim, index); - else + else update_count (0, dim, index); previous = &frame; @@ -419,8 +441,8 @@ namespace MR { default_type max_separation = 0.0; default_type sum_separation = 0.0; - if (nslices < 2) - return std::isfinite (frames[0]->slice_spacing) ? + if (nslices < 2) + return std::isfinite (frames[0]->slice_spacing) ? frames[0]->slice_spacing : frames[0]->slice_thickness; for (size_t n = 0; n < nslices-1; ++n) { diff --git a/core/file/dicom/image.h b/core/file/dicom/image.h index ed0eacf017..1d7ec41968 100644 --- a/core/file/dicom/image.h +++ b/core/file/dicom/image.h @@ -29,14 +29,14 @@ namespace MR { class Frame { MEMALIGN(Frame) public: - Frame () { + Frame () { acq_dim[0] = acq_dim[1] = dim[0] = dim[1] = instance = series_num = acq = sequence = UINT_MAX; position_vector[0] = position_vector[1] = position_vector[2] = NAN; orientation_x[0] = orientation_x[1] = orientation_x[2] = NAN; orientation_y[0] = orientation_y[1] = orientation_y[2] = NAN; orientation_z[0] = orientation_z[1] = orientation_z[2] = NAN; distance = NAN; - pixel_size[0] = pixel_size[1] = slice_thickness = slice_spacing = NAN; + pixel_size[0] = pixel_size[1] = slice_thickness = slice_spacing = NAN; scale_intercept = 0.0; scale_slope = 1.0; bvalue = G[0] = G[1] = G[2] = NAN; @@ -45,8 +45,9 @@ namespace MR { transfer_syntax_supported = true; pe_axis = 3; pe_sign = 0; - pixel_bandwidth = bandwidth_per_pixel_phase_encode = echo_time = NAN; - echo_train_length = 0; + pixel_bandwidth = bandwidth_per_pixel_phase_encode = echo_time = repetition_time = flip_angle = partial_fourier_fraction = NAN; + echo_train_length = parallel_inplane_factor = 0; + partial_fourier_axis = -1; } size_t acq_dim[2], dim[2], series_num, instance, acq, sequence; @@ -57,25 +58,26 @@ namespace MR { bool DW_scheme_wrt_image, transfer_syntax_supported; size_t pe_axis; int pe_sign; - default_type pixel_bandwidth, bandwidth_per_pixel_phase_encode, echo_time; - size_t echo_train_length; + default_type pixel_bandwidth, bandwidth_per_pixel_phase_encode, echo_time, repetition_time, flip_angle, partial_fourier_fraction; + size_t echo_train_length, parallel_inplane_factor; + int partial_fourier_axis; vector index; bool operator< (const Frame& frame) const { - if (series_num != frame.series_num) + if (series_num != frame.series_num) return series_num < frame.series_num; - if (acq != frame.acq) + if (acq != frame.acq) return acq < frame.acq; assert (std::isfinite (distance)); assert (std::isfinite (frame.distance)); - if (distance != frame.distance) + if (distance != frame.distance) return distance < frame.distance; for (size_t n = index.size(); n--;) if (index[n] != frame.index[n]) return index[n] < frame.index[n]; - if (sequence != frame.sequence) + if (sequence != frame.sequence) return sequence < frame.sequence; - if (instance != frame.instance) + if (instance != frame.instance) return instance < frame.instance; return false; } @@ -83,13 +85,13 @@ namespace MR { void calc_distance () { - if (!std::isfinite (orientation_z[0])) + if (!std::isfinite (orientation_z[0])) orientation_z = orientation_x.cross (orientation_y); else { Eigen::Vector3 normal = orientation_x.cross (orientation_y); if (normal.dot (orientation_z) < 0.0) orientation_z = -normal; - else + else orientation_z = normal; } @@ -118,8 +120,8 @@ namespace MR { class Image : public Frame { MEMALIGN(Image) public: - Image (Series* parent = NULL) : - series (parent), + Image (Series* parent = NULL) : + series (parent), images_in_mosaic (0), is_BE (false), in_frames (false) { } diff --git a/core/file/dicom/mapper.cpp b/core/file/dicom/mapper.cpp index 1e2d78a132..f7a6ada550 100644 --- a/core/file/dicom/mapper.cpp +++ b/core/file/dicom/mapper.cpp @@ -38,7 +38,7 @@ namespace MR { sbuf += " " + format_ID (patient->ID); if (series[0]->modality.size()) sbuf += std::string (" [") + series[0]->modality + "]"; - if (series[0]->name.size()) + if (series[0]->name.size()) sbuf += std::string (" ") + series[0]->name; add_line (H.keyval()["comments"], sbuf); H.name() = sbuf; @@ -51,9 +51,9 @@ namespace MR { try { series_it->read(); } - catch (Exception& E) { + catch (Exception& E) { E.display(); - throw Exception ("error reading series " + str (series_it->number) + " of DICOM image \"" + H.name() + "\""); + throw Exception ("error reading series " + str (series_it->number) + " of DICOM image \"" + H.name() + "\""); } std::sort (series_it->begin(), series_it->end(), compare_ptr_contents()); @@ -70,11 +70,11 @@ namespace MR { // if multi-frame, loop over frames in image: if (image_it->frames.size()) { std::sort (image_it->frames.begin(), image_it->frames.end(), compare_ptr_contents()); - for (auto frame_it : image_it->frames) + for (auto frame_it : image_it->frames) frames.push_back (frame_it.get()); } // otherwise add image frame: - else + else frames.push_back (image_it.get()); } } @@ -90,23 +90,23 @@ namespace MR { if (dim[0] > 1) { // switch axes so slice dim is inner-most: vector list (frames); vector::iterator it = frames.begin(); - for (size_t k = 0; k < dim[2]; ++k) - for (size_t i = 0; i < dim[0]; ++i) - for (size_t j = 0; j < dim[1]; ++j) + for (size_t k = 0; k < dim[2]; ++k) + for (size_t i = 0; i < dim[0]; ++i) + for (size_t j = 0; j < dim[1]; ++j) *(it++) = list[i+dim[0]*(j+dim[1]*k)]; } default_type slice_separation = Frame::get_slice_separation (frames, dim[1]); - if (series[0]->study->name.size()) + if (series[0]->study->name.size()) add_line (H.keyval()["comments"], std::string ("study: " + series[0]->study->name)); - if (patient->DOB.size()) + if (patient->DOB.size()) add_line (H.keyval()["comments"], std::string ("DOB: " + format_date (patient->DOB))); if (series[0]->date.size()) { sbuf = "DOS: " + format_date (series[0]->date); - if (series[0]->time.size()) + if (series[0]->time.size()) sbuf += " " + format_time (series[0]->time); add_line (H.keyval()["comments"], sbuf); } @@ -115,9 +115,23 @@ namespace MR { if (std::isfinite (image.echo_time)) H.keyval()["EchoTime"] = str (0.001 * image.echo_time, 6); + if (std::isfinite (image.flip_angle)) + H.keyval()["FlipAngle"] = str (image.flip_angle, 6); + if (image.parallel_inplane_factor) + H.keyval()["ParallelReductionFactorInPlane"] = str (image.parallel_inplane_factor); + if (std::isfinite (image.partial_fourier_fraction)) + H.keyval()["PartialFourier"] = str (image.partial_fourier_fraction, 6); + // TODO This will need handling with regards to axis permutation + switch (image.partial_fourier_axis) { + case 0: H.keyval()["PartialFourierDirection"] = "i"; break; + case 1: H.keyval()["PartialFourierDirection"] = "j"; break; + case 2: H.keyval()["PartialFourierDirection"] = "k"; break; + } + if (std::isfinite (image.repetition_time)) + H.keyval()["RepetitionTime"] = str (0.001 * image.repetition_time, 6); size_t nchannels = image.frames.size() ? 1 : image.data_size / (image.dim[0] * image.dim[1] * (image.bits_alloc/8)); - if (nchannels > 1) + if (nchannels > 1) INFO ("data segment is larger than expected from image dimensions - interpreting as multi-channel data"); H.ndim() = 3 + (dim[0]*dim[2]>1) + (nchannels>1); @@ -149,16 +163,16 @@ namespace MR { } - if (image.bits_alloc == 8) + if (image.bits_alloc == 8) H.datatype() = DataType::UInt8; else if (image.bits_alloc == 16) { H.datatype() = DataType::UInt16; - if (image.is_BE) + if (image.is_BE) H.datatype() = DataType::UInt16 | DataType::BigEndian; - else + else H.datatype() = DataType::UInt16 | DataType::LittleEndian; } - else throw Exception ("unexpected number of allocated bits per pixel (" + str (image.bits_alloc) + else throw Exception ("unexpected number of allocated bits per pixel (" + str (image.bits_alloc) + ") in file \"" + H.name() + "\""); H.set_intensity_scaling (image.scale_slope, image.scale_intercept); @@ -210,8 +224,8 @@ namespace MR { H.size(2) = image.images_in_mosaic; if (image.dim[0] % image.acq_dim[0] || image.dim[1] % image.acq_dim[1]) { - WARN ("acquisition matrix [ " + str (image.acq_dim[0]) + " " + str (image.acq_dim[1]) - + " ] does not fit into DICOM mosaic [ " + str (image.dim[0]) + " " + str (image.dim[1]) + WARN ("acquisition matrix [ " + str (image.acq_dim[0]) + " " + str (image.acq_dim[1]) + + " ] does not fit into DICOM mosaic [ " + str (image.dim[0]) + " " + str (image.dim[1]) + " ] - adjusting matrix size to suit"); H.size(0) = image.dim[0] / size_t (float(image.dim[0]) / float(image.acq_dim[0])); H.size(1) = image.dim[1] / size_t (float(image.dim[1]) / float(image.acq_dim[1])); @@ -219,15 +233,15 @@ namespace MR { float xinc = H.spacing(0) * (image.dim[0] - H.size(0)) / 2.0; float yinc = H.spacing(1) * (image.dim[1] - H.size(1)) / 2.0; - for (size_t i = 0; i < 3; i++) + for (size_t i = 0; i < 3; i++) H.transform()(i,3) += xinc * H.transform()(i,0) + yinc * H.transform()(i,1); io_handler.reset (new MR::ImageIO::Mosaic (H, image.dim[0], image.dim[1], H.size (0), H.size (1), H.size (2))); } - else + else io_handler.reset (new MR::ImageIO::Default (H)); - for (size_t n = 0; n < frames.size(); ++n) + for (size_t n = 0; n < frames.size(); ++n) io_handler->files.push_back (File::Entry (frames[n]->filename, frames[n]->data)); return io_handler; diff --git a/lib/mrtrix3/image.py b/lib/mrtrix3/image.py index 4ca0a97ad7..3548955af3 100644 --- a/lib/mrtrix3/image.py +++ b/lib/mrtrix3/image.py @@ -47,20 +47,29 @@ def headerKeyValue(image_path, key): -def match(image_one, image_two): +def match(image_one, image_two, max_dim=0): import math from mrtrix3 import app debug_prefix = '\'' + image_one + '\' \'' + image_two + '\'' # Image dimensions - one_dim = [ int(i) for i in headerField(image_one, 'size').split() ] - two_dim = [ int(i) for i in headerField(image_two, 'size').split() ] - if not one_dim == two_dim: - app.debug(debug_prefix + ' dimension mismatch (' + str(one_dim) + ' ' + str(two_dim) + ')') + one_size = [ int(i) for i in headerField(image_one, 'size').split() ] + two_size = [ int(i) for i in headerField(image_two, 'size').split() ] + if max_dim: + if max_dim > min(len(one_size), len(two_size)): + app.debug(debug_prefix + ' dimensionality less than specified maximum (' + str(max_dim) + ')') + return False + else: + if not len(one_size) == len(two_size): + app.debug(debug_prefix + ' dimensionality mismatch (' + str(len(one_size)) + ' vs. ' + str(len(two_size)) + ')') + return False + max_dim = len(one_size) + if not one_size[:max_dim] == two_size[:max_dim]: + app.debug(debug_prefix + ' axis size mismatch (' + str(one_size) + ' ' + str(two_size) + ')') return False # Voxel size one_spacing = [ float(f) for f in headerField(image_one, 'vox').split() ] two_spacing = [ float(f) for f in headerField(image_two, 'vox').split() ] - for one, two in zip(one_spacing, two_spacing): + for one, two in zip(one_spacing[:max_dim], two_spacing[:max_dim]): if one and two and not math.isnan(one) and not math.isnan(two): if (abs(two-one) / (0.5*(one+two))) > 1e-04: app.debug(debug_prefix + ' voxel size mismatch (' + str(one_spacing) + ' ' + str(two_spacing) + ')') From 5fe4490c966142fbd2e5773fd7460146b2e792c2 Mon Sep 17 00:00:00 2001 From: Max Pietsch Date: Sat, 30 Sep 2017 16:48:03 +0100 Subject: [PATCH 166/538] population_template: ignore hidden input files --- bin/population_template | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/bin/population_template b/bin/population_template index 9d4876c0ab..ec22873b46 100755 --- a/bin/population_template +++ b/bin/population_template @@ -38,10 +38,19 @@ def abspath(*arg): def relpath(*arg): return os.path.relpath(os.path.join(*arg), app.workingDir) -def allindir(directory): - return ' '.join( [ os.path.join(directory, filename) for filename in os.listdir(directory) ] ) - - +def allindir(directory, dir_path=True, ignore_hidden_files=True): + def is_hidden(directory, filename): + if os.name== 'nt': + import win32api, win32con + attribute = win32api.GetFileAttributes(os.path.join(directory, filename)) + return attribute & (win32con.FILE_ATTRIBUTE_HIDDEN | win32con.FILE_ATTRIBUTE_SYSTEM) + else: + return filename.startswith('.') + flist = sorted([filename for filename in os.listdir(directory) if (not ignore_hidden_files or not is_hidden (directory, filename)) ]) + if dir_path: + return [ os.path.join(directory, filename) for filename in flist ] + else: + return flist try: from numpy import loadtxt, savetxt, dot @@ -215,7 +224,7 @@ app.args.input_dir = relpath(app.args.input_dir) inputDir = app.args.input_dir if not os.path.exists(inputDir): app.error('input directory not found') -inFiles = sorted(os.listdir(inputDir)) +inFiles = sorted(allindir(inputDir, dir_path=False)) if len(inFiles) <= 1: app.console('Not enough images found in input directory. More than one image is needed to generate a population template') else: @@ -251,7 +260,7 @@ if app.args.mask_dir: maskDir = app.args.mask_dir if not os.path.exists(maskDir): app.error('mask directory not found') - maskFiles = os.listdir(maskDir) + maskFiles = allindir(maskDir, dir_path=False) if len(maskFiles) < len(inFiles): app.error('there are not enough mask images for the number of images in the input directory') maskCommonPostfix = path.commonPostfix(maskFiles) @@ -541,7 +550,7 @@ else: run.function(remove, os.path.join('inputs_transformed', i.prefix + '_translated.mif')) -run.command('mrmath ' + allindir('inputs_transformed') + ' mean initial_template.mif') +run.command('mrmath ' + ' '.join(allindir('inputs_transformed')) + ' mean initial_template.mif') current_template = 'initial_template.mif' @@ -608,7 +617,7 @@ else: check_linear_transformation(os.path.join('linear_transforms_%i' % level, '%s.txt' % i.prefix), command, pause_on_warn=do_pause_on_warn) # Here we ensure the template doesn't drift or scale - run.command('transformcalc ' + allindir('linear_transforms_%i' % level) + ' average linear_transform_average.txt -force -quiet') + run.command('transformcalc ' + ' '.join(allindir('linear_transforms_%i' % level)) + ' average linear_transform_average.txt -force -quiet') if linear_type[level] == 'rigid': run.command('transformcalc linear_transform_average.txt rigid linear_transform_average.txt -force -quiet') run.command('transformcalc linear_transform_average.txt invert linear_transform_average_inv.txt -force -quiet') @@ -628,7 +637,7 @@ else: datatype + ' ' + \ '-force') - run.command('mrmath ' + allindir('inputs_transformed') + ' mean linear_template' + str(level) + '.mif -force') + run.command('mrmath ' + ' '.join(allindir('inputs_transformed')) + ' mean linear_template' + str(level) + '.mif -force') current_template = 'linear_template' + str(level) + '.mif' for entry in os.listdir('linear_transforms_%i' % level): @@ -643,7 +652,7 @@ if useMasks and (dononlinear or app.args.template_mask): '-linear ' + os.path.join('linear_transforms', '%s.txt' % i.prefix) + ' ' + \ os.path.join('masks_transformed', '%s.mif' % i.prefix) + ' ' + \ '-force') - run.command ('mrmath ' + allindir('masks_transformed') + ' min - | maskfilter - median - | maskfilter - dilate -npass 5 init_nl_template_mask.mif -force') + run.command ('mrmath ' + ' '.join(allindir('masks_transformed')) + ' min - | maskfilter - median - | maskfilter - dilate -npass 5 init_nl_template_mask.mif -force') current_template_mask = 'init_nl_template_mask.mif' if dononlinear: @@ -696,11 +705,11 @@ if dononlinear: '-interp nearest ' + '-force') - run.command('mrmath ' + allindir('inputs_transformed') + ' mean nl_template' + str(level) + '.mif') + run.command('mrmath ' + ' '.join(allindir('inputs_transformed')) + ' mean nl_template' + str(level) + '.mif') current_template = 'nl_template' + str(level) + '.mif' if useMasks: - run.command ('mrmath ' + allindir('masks_transformed') + ' min - | maskfilter - median - | maskfilter - dilate -npass 5 nl_template_mask' + str(level) + '.mif') + run.command ('mrmath ' + ' '.join(allindir('masks_transformed')) + ' min - | maskfilter - median - | maskfilter - dilate -npass 5 nl_template_mask' + str(level) + '.mif') current_template_mask = 'nl_template_mask' + str(level) + '.mif' if level < len(nl_scales) - 1: From a5023e4c8c5d2ddc1ef498cdc052a8af52cc2bc6 Mon Sep 17 00:00:00 2001 From: Max Pietsch Date: Sat, 30 Sep 2017 17:01:35 +0100 Subject: [PATCH 167/538] dwiintensitynorm: ignore hidden input files --- bin/dwiintensitynorm | 5 +++-- bin/population_template | 15 +-------------- lib/mrtrix3/path.py | 16 +++++++++++++++- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/bin/dwiintensitynorm b/bin/dwiintensitynorm index 777efad61a..25e7960ea0 100755 --- a/bin/dwiintensitynorm +++ b/bin/dwiintensitynorm @@ -12,6 +12,7 @@ sys.path.insert(0, lib_folder) from mrtrix3 import app, file, image, path, run #pylint: disable=redefined-builtin +from mrtrix3.path import allindir def abspath(*arg): return os.path.abspath(os.path.join(*arg)) @@ -45,7 +46,7 @@ app.args.input_dir = relpath(app.args.input_dir) inputDir = app.args.input_dir if not os.path.exists(inputDir): app.error('input directory not found') -inFiles = os.listdir(inputDir) +inFiles = allindir(inputDir, dir_path=False) if len(inFiles) <= 1: app.console('not enough images found in input directory. More than one image is needed to perform a group-wise intensity normalisation') else: @@ -55,7 +56,7 @@ app.args.mask_dir = relpath(app.args.mask_dir) maskDir = app.args.mask_dir if not os.path.exists(maskDir): app.error('mask directory not found') -maskFiles = os.listdir(maskDir) +maskFiles = allindir(maskDir, dir_path=False) if len(maskFiles) != len(inFiles): app.error('the number of images in the mask directory does not equal the number of images in the input directory') maskCommonPostfix = path.commonPostfix(maskFiles) diff --git a/bin/population_template b/bin/population_template index ec22873b46..d6b53f419f 100755 --- a/bin/population_template +++ b/bin/population_template @@ -31,6 +31,7 @@ import math from mrtrix3 import app, file, image, path, run #pylint: disable=redefined-builtin +from mrtrix3.path import allindir def abspath(*arg): return os.path.abspath(os.path.join(*arg)) @@ -38,20 +39,6 @@ def abspath(*arg): def relpath(*arg): return os.path.relpath(os.path.join(*arg), app.workingDir) -def allindir(directory, dir_path=True, ignore_hidden_files=True): - def is_hidden(directory, filename): - if os.name== 'nt': - import win32api, win32con - attribute = win32api.GetFileAttributes(os.path.join(directory, filename)) - return attribute & (win32con.FILE_ATTRIBUTE_HIDDEN | win32con.FILE_ATTRIBUTE_SYSTEM) - else: - return filename.startswith('.') - flist = sorted([filename for filename in os.listdir(directory) if (not ignore_hidden_files or not is_hidden (directory, filename)) ]) - if dir_path: - return [ os.path.join(directory, filename) for filename in flist ] - else: - return flist - try: from numpy import loadtxt, savetxt, dot except ImportError: diff --git a/lib/mrtrix3/path.py b/lib/mrtrix3/path.py index 18cfab06b2..5c928cd54e 100644 --- a/lib/mrtrix3/path.py +++ b/lib/mrtrix3/path.py @@ -19,7 +19,21 @@ def commonPostfix(inputFiles): #pylint: disable=unused-variable app.debug('Common postfix of ' + str(len(inputFiles)) + ' is \'' + common + '\'') return common - +# List the content of a directory +def allindir(directory, dir_path=True, ignore_hidden_files=True): + import os + def is_hidden(directory, filename): + if os.name== 'nt': + import win32api, win32con + attribute = win32api.GetFileAttributes(os.path.join(directory, filename)) + return attribute & (win32con.FILE_ATTRIBUTE_HIDDEN | win32con.FILE_ATTRIBUTE_SYSTEM) + else: + return filename.startswith('.') + flist = sorted([filename for filename in os.listdir(directory) if (not ignore_hidden_files or not is_hidden (directory, filename)) ]) + if dir_path: + return [ os.path.join(directory, filename) for filename in flist ] + else: + return flist # Get the full absolute path to a user-specified location. # This function serves two purposes: From fbe9441d30122ed20ad6ad0910d32c601d9b33de Mon Sep 17 00:00:00 2001 From: Max Pietsch Date: Sun, 1 Oct 2017 17:02:53 +0100 Subject: [PATCH 168/538] path.py: fix for pylint --- lib/mrtrix3/path.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/mrtrix3/path.py b/lib/mrtrix3/path.py index 5c928cd54e..2b09d74f0d 100644 --- a/lib/mrtrix3/path.py +++ b/lib/mrtrix3/path.py @@ -20,20 +20,19 @@ def commonPostfix(inputFiles): #pylint: disable=unused-variable return common # List the content of a directory -def allindir(directory, dir_path=True, ignore_hidden_files=True): +def allindir(directory, dir_path=True, ignore_hidden_files=True): #pylint: disable=unused-variable import os def is_hidden(directory, filename): - if os.name== 'nt': - import win32api, win32con + if os.name == 'nt': + import win32api, win32con #pylint: disable=import-error attribute = win32api.GetFileAttributes(os.path.join(directory, filename)) return attribute & (win32con.FILE_ATTRIBUTE_HIDDEN | win32con.FILE_ATTRIBUTE_SYSTEM) - else: - return filename.startswith('.') - flist = sorted([filename for filename in os.listdir(directory) if (not ignore_hidden_files or not is_hidden (directory, filename)) ]) + return filename.startswith('.') + + flist = sorted([filename for filename in os.listdir(directory) if not ignore_hidden_files or not is_hidden (directory, filename) ]) if dir_path: return [ os.path.join(directory, filename) for filename in flist ] - else: - return flist + return flist # Get the full absolute path to a user-specified location. # This function serves two purposes: From 89cb42da6f8068fc3d2d743f99cfb448d4ddbfc5 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 2 Oct 2017 21:38:01 +1100 Subject: [PATCH 169/538] dwipreproc: Updates following merging 'dev' into 'dwipreproc_alignment' - Remove some errors introduced during the merging process. - Do some renaming of variables, to best separate the sources of data (i.e. 'dwi', 'se-epi') from the methods used (topup, eddy). --- bin/dwipreproc | 297 ++++++++++++++++++++++--------------------- lib/mrtrix3/image.py | 4 +- 2 files changed, 151 insertions(+), 150 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 276b684382..f94162e1e9 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -133,18 +133,19 @@ app.gotoTempDir() dwi_header = image.Header('dwi.mif') if not len(dwi_header.size()) == 4: app.error('Input DWI must be a 4D image') -num_volumes = dwi_header.size()[3] +dwi_num_volumes = dwi_header.size()[3] dwi_pe_scheme = phaseEncoding.getScheme(dwi_header) if app.args.se_epi: se_epi_header = image.Header('se_epi.mif') - if not len(se_epi_header.size()) == 4: - app.error('File provided using -se_epi option must contain more than one image volume') - topup_pe_scheme = phaseEncoding.getScheme(se_epi_header) + # This doesn't necessarily apply any more: May be able to combine e.g. a P>>A from -se_epi with an A>>P b=0 image from the DWIs +# if not len(se_epi_header.size()) == 4: +# app.error('File provided using -se_epi option must contain more than one image volume') + se_epi_pe_scheme = phaseEncoding.getScheme(se_epi_header) if 'dw_scheme' not in dwi_header.keyval(): app.error('No diffusion gradient table found') grad = dwi_header.keyval()['dw_scheme'] -if not len(grad) == num_volumes: - app.error('Number of lines in gradient table (' + str(len(grad)) + ') does not match input image (' + str(num_volumes) + ' volumes); check your input data') +if not len(grad) == dwi_num_volumes: + app.error('Number of lines in gradient table (' + str(len(grad)) + ') does not match input image (' + str(dwi_num_volumes) + ' volumes); check your input data') @@ -184,7 +185,7 @@ def grads_match(one, two): # Manually generate a phase-encoding table for the input DWI based on user input dwi_manual_pe_scheme = None -topup_manual_pe_scheme = None +se_epi_manual_pe_scheme = None auto_trt = 0.1 dwi_auto_trt_warning = False if manual_pe_dir: @@ -200,22 +201,22 @@ if manual_pe_dir: if PE_design == 'None': line = list(manual_pe_dir) line.append(trt) - dwi_manual_pe_scheme = [ line ] * num_volumes + dwi_manual_pe_scheme = [ line ] * dwi_num_volumes # With 'Pair', also need to construct the manual scheme for SE EPIs elif PE_design == 'Pair': line = list(manual_pe_dir) line.append(trt) - dwi_manual_pe_scheme = [ line ] * num_volumes - num_topup_volumes = se_epi_header.size()[3] - if num_topup_volumes%2: + dwi_manual_pe_scheme = [ line ] * dwi_num_volumes + se_epi_num_volumes = se_epi_header.size()[3] + if se_epi_num_volumes%2: app.error('If using -rpe_pair option, image provided using -se_epi must contain an even number of volumes') # Assume that first half of volumes have same direction as series; # second half have the opposite direction - topup_manual_pe_scheme = [ line ] * int(num_topup_volumes/2) + se_epi_manual_pe_scheme = [ line ] * int(se_epi_num_volumes/2) line = [ (-i if i else 0.0) for i in manual_pe_dir ] line.append(trt) - topup_manual_pe_scheme.extend( [ line ] * int(num_topup_volumes/2) ) + se_epi_manual_pe_scheme.extend( [ line ] * int(se_epi_num_volumes/2) ) # If -rpe_all, need to scan through grad and figure out the pairings # This will be required if relying on user-specified phase encode direction @@ -227,15 +228,15 @@ if manual_pe_dir: # despite having the same phase-encoding direction. Instead, explicitly enforce # that volumes must be matched between the first and second halves of the DWI data. elif PE_design == 'All': - if num_volumes%2: + if dwi_num_volumes%2: app.error('If using -rpe_all option, input image must contain an even number of volumes') - grads_matched = [ num_volumes ] * num_volumes + grads_matched = [ dwi_num_volumes ] * dwi_num_volumes grad_pairs = [ ] - app.debug('Commencing gradient direction matching; ' + str(num_volumes) + ' volumes') - for index1 in range(int(num_volumes/2)): - if grads_matched[index1] == num_volumes: # As yet unpaired - for index2 in range(int(num_volumes/2), num_volumes): - if grads_matched[index2] == num_volumes: # Also as yet unpaired + app.debug('Commencing gradient direction matching; ' + str(dwi_num_volumes) + ' volumes') + for index1 in range(int(dwi_num_volumes/2)): + if grads_matched[index1] == dwi_num_volumes: # As yet unpaired + for index2 in range(int(dwi_num_volumes/2), dwi_num_volumes): + if grads_matched[index2] == dwi_num_volumes: # Also as yet unpaired if grads_match(grad[index1], grad[index2]): grads_matched[index1] = index2 grads_matched[index2] = index1 @@ -244,15 +245,15 @@ if manual_pe_dir: break else: app.error('Unable to determine matching reversed phase-encode direction volume for DWI volume ' + str(index1)) - if not len(grad_pairs) == num_volumes/2: + if not len(grad_pairs) == dwi_num_volumes/2: app.error('Unable to determine complete matching DWI volume pairs for reversed phase-encode combination') # Construct manual PE scheme here: # Regardless of whether or not there's a scheme in the header, need to have it: # if there's one in the header, want to compare to the manually-generated one dwi_manual_pe_scheme = [ ] - for index in range(0, num_volumes): + for index in range(0, dwi_num_volumes): line = list(manual_pe_dir) - if index >= int(num_volumes/2): + if index >= int(dwi_num_volumes/2): line = [ (-i if i else 0.0) for i in line ] line.append(trt) dwi_manual_pe_scheme.append(line) @@ -321,20 +322,22 @@ if dwi_manual_pe_scheme: # Deal with the phase-encoding of the images to be fed to topup (if applicable) -overwrite_topup_pe_scheme = False -topup_in_path = 'topup_in.mif' +overwrite_se_epi_pe_scheme = False +se_epi_path = 'se_epi.mif' dwi_permute_volumes_pre_eddy_option = '' dwi_permute_volumes_post_eddy_option = '' -dwi_bzero_added_to_topup = False +dwi_bzero_added_to_se_epi = False if app.args.se_epi: # Newest version of eddy requires that topup field be on the same grid as the eddy input DWI - if not image.match('dwi.mif', 'topup_in.mif', 3): + if not image.match(dwi_header, se_epi_header, 3): app.console('DWIs and SE-EPI images used for inhomogeneity field estimation are defined on different image grids; ' 'the latter will be automatically re-gridded to match the former') - run.command('mrtransform ' + topup_in_path + ' - -interp sinc -template dwi.mif | mrcalc - 0.0 -max topup_in_regrid.mif') - file.delTempFile(topup_in_path) - topup_in_path = 'topup_in_regrid.mif' + new_se_epi_path = 'se_epi_regrid.mif' + run.command('mrtransform ' + se_epi_path + ' - -interp sinc -template dwi.mif | mrcalc - 0.0 -max ' + new_se_epi_path) + file.delTemporary(se_epi_path) + se_epi_path = new_se_epi_path + se_epi_header = image.Header(se_epi_path) # 3 possible sources of PE information: DWI header, topup image header, command-line # Any pair of these may conflict, and any one could be absent @@ -348,22 +351,22 @@ if app.args.se_epi: # * If _not_ present in own header: # - If provided at command-line, infer appropriately # - If not provided at command-line, but the DWI header has that information, infer appropriately - if topup_pe_scheme: + if se_epi_pe_scheme: if manual_pe_dir: - if not scheme_dirs_match(topup_pe_scheme, topup_manual_pe_scheme): + if not scheme_dirs_match(se_epi_pe_scheme, se_epi_manual_pe_scheme): app.warn('User-defined phase-encoding direction design does not match what is stored in SE EPI image header; proceeding with user specification') - overwrite_topup_pe_scheme = True + overwrite_se_epi_pe_scheme = True if manual_trt: - if not scheme_times_match(topup_pe_scheme, topup_manual_pe_scheme): + if not scheme_times_match(se_epi_pe_scheme, se_epi_manual_pe_scheme): app.warn('User-defined total readout time does not match what is stored in SE EPI image header; proceeding with user specification') - overwrite_topup_pe_scheme = True - if overwrite_topup_pe_scheme: - topup_pe_scheme = topup_manual_pe_scheme + overwrite_se_epi_pe_scheme = True + if overwrite_se_epi_pe_scheme: + se_epi_pe_scheme = se_epi_manual_pe_scheme else: - topup_manual_pe_scheme = None # To guarantee that these data are never used + se_epi_manual_pe_scheme = None # To guarantee that these data are never used else: - overwrite_topup_pe_scheme = True - topup_pe_scheme = topup_manual_pe_scheme + overwrite_se_epi_pe_scheme = True + se_epi_pe_scheme = se_epi_manual_pe_scheme elif PE_design == 'All': # Criteria: @@ -372,7 +375,7 @@ if app.args.se_epi: # * If _not_ present in own header: # - Don't have enough information to proceed # - Is this too harsh? (e.g. Have rules by which it may be inferred from the DWI header / command-line) - if not topup_pe_scheme: + if not se_epi_pe_scheme: app.error('If explicitly including SE EPI images when using -rpe_all option, they must come with their own associated phase-encoding information in the image header') elif PE_design == 'Header': @@ -381,33 +384,32 @@ if app.args.se_epi: # Nothing to do (-pe_dir option is mutually exclusive) # * If _not_ present in own header: # Cannot proceed - if not topup_pe_scheme: + if not se_epi_pe_scheme: app.error('No phase-encoding information present in SE EPI image header') -<<<<<<< HEAD # If there is no phase encoding contrast within the SE-EPI series, # try combining it with the DWI b=0 volumes, see if that produces some contrast # However, this should probably only be permitted if the -align_seepi option is defined - topup_pe_scheme_has_contrast = 'pe_scheme' in se_epi_header.keyval() - if not topup_pe_scheme_has_contrast: + se_epi_pe_scheme_has_contrast = 'pe_scheme' in se_epi_header.keyval() + if not se_epi_pe_scheme_has_contrast: if app.args.align_seepi: app.console('No phase-encoding contrast present in SE-EPI images; will examine again after combining with DWI b=0 images') - run.command('dwiextract dwi.mif - -bzero | mrcat - topup_in.mif topup_in_dwibzero.mif -axis 3') - new_topup_in_path = os.path.splitext(topup_in_path)[0] + '_dwibzero.mif' - se_epi_header = image.Header(new_topup_in_path) - topup_pe_scheme_has_contrast = 'pe_scheme' in se_epi_header.keyval() - if topup_pe_scheme_has_contrast: - file.delTempFile(topup_in_path) - topup_in_path = new_topup_in_path - topup_pe_scheme = phaseEncoding.getScheme(se_epi_header) - dwi_bzero_added_to_topup = True + new_se_epi_path = os.path.splitext(se_epi_path)[0] + '_dwibzeros.mif' + run.command('dwiextract dwi.mif - -bzero | mrcat - se_epi.mif ' + new_se_epi_path + ' -axis 3') + se_epi_header = image.Header(new_se_epi_path) + se_epi_pe_scheme_has_contrast = 'pe_scheme' in se_epi_header.keyval() + if se_epi_pe_scheme_has_contrast: + file.delTemporary(se_epi_path) + se_epi_path = new_se_epi_path + se_epi_pe_scheme = phaseEncoding.getScheme(se_epi_header) + dwi_bzero_added_to_se_epi = True else: - app.error('No phase-encoding contrast present in SE-EPI images, even after concatenating with b=0 images; ' + app.error('No phase-encoding contrast present in SE-EPI images, even after concatenating with b=0 images due to -align_seepi option; ' 'cannot perform inhomogeneity field estimation') else: app.error('No phase-encoding contrast present in SE-EPI images; cannot perform inhomogeneity field estimation') if app.args.align_seepi: - + # If we are using the -se_epi option, and hence the input images to topup have not come from the DWIs themselves, # we need to insert the first b=0 DWI volume to the start of the topup input image. Otherwise, the field estimated # by topup will not be correctly aligned with the volumes as they are processed by eddy. @@ -426,22 +428,22 @@ if app.args.se_epi: dwi_first_bzero_pe = dwi_manual_pe_scheme[dwi_first_bzero_index] if overwrite_dwi_pe_scheme else dwi_pe_scheme[dwi_first_bzero_index] dwi_te = dwi_header.keyval().get('EchoTime') - fmap_te = se_epi_header.keyval().get('EchoTime') # TODO Rename to se_epi_te - if dwi_te and fmap_te and not dwi_te == fmap_te: + se_epi_te = se_epi_header.keyval().get('EchoTime') + if dwi_te and se_epi_te and dwi_te != se_epi_te: app.warn('It appears that the spin-echo EPI images used for inhomogeneity field estimation have a different echo time to the DWIs being corrected. ' 'This may cause issues in estimation of the field, as the first DWI b=0 volume will be added to the input series to topup ' 'due to use of the -align_seepi option.') dwi_tr = dwi_header.keyval().get('RepetitionTime') - fmap_tr = se_epi_header.keyval().get('RepetitionTime') - if dwi_tr and fmap_tr and not dwi_tr == fmap_tr: + se_epi_tr = se_epi_header.keyval().get('RepetitionTime') + if dwi_tr and se_epi_tr and dwi_tr != se_epi_tr: app.warn('It appears that the spin-echo EPI images used for inhomogeneity field estimation have a different repetition time to the DWIs being corrected. ' 'This may cause issues in estimation of the field, as the first DWI b=0 volume will be added to the input series to topup ' 'due to use of the -align_seepi option.') dwi_flip = dwi_header.keyval().get('FlipAngle') - fmap_flip = se_epi_header.keyval().get('FlipAngle') - if dwi_flip and fmap_flip and not dwi_flip == fmap_flip: + se_epi_flip = se_epi_header.keyval().get('FlipAngle') + if dwi_flip and se_epi_flip and dwi_flip != se_epi_flip: app.warn('It appears that the spin-echo EPI images used for inhomogeneity field estimation have a different flip angle to the DWIs being corrected. ' 'This may cause issues in estimation of the field, as the first DWI b=0 volume will be added to the input series to topup ' 'due to use of the -align_seepi option.') @@ -453,43 +455,44 @@ if app.args.se_epi: # Note however that in this instance it may still be necessary to permute the volumes within the # DWI series if the first volume is not a b=0 volume; but the first b=0 volume will inherently # already be the first volume in the input to topup - if not dwi_bzero_added_to_topup: - topup_pe_sum = [ 0, 0, 0 ] - topup_volume_to_remove = len(topup_pe_scheme) - for index, line in enumerate(topup_pe_scheme): - topup_pe_sum = [ i + j for i, j in zip(topup_pe_sum, line[0:3]) ] - if topup_volume_to_remove == len(topup_pe_scheme) and line[0:3] == dwi_first_bzero_pe[0:3]: - topup_volume_to_remove = index - if (topup_pe_sum == [ 0, 0, 0 ]) and (topup_volume_to_remove < len(topup_pe_scheme)): - app.console('Balanced phase-encoding scheme detected in \'' + app.args.se_epi + '\'; volume ' + str(topup_volume_to_remove) + ' will be removed and replaced with first b=0 from DWIs') - run.command('mrconvert ' + topup_in_path + ' - -coord 3 ' + ','.join([str(index) for index in range(len(topup_pe_scheme)) if not index == topup_volume_to_remove]) + ' | mrcat dwi_first_bzero.mif - topup_in_dwibzero.mif -axis 3') + if not dwi_bzero_added_to_se_epi: + se_epi_pe_sum = [ 0, 0, 0 ] + se_epi_volume_to_remove = len(se_epi_pe_scheme) + for index, line in enumerate(se_epi_pe_scheme): + se_epi_pe_sum = [ i + j for i, j in zip(se_epi_pe_sum, line[0:3]) ] + if se_epi_volume_to_remove == len(se_epi_pe_scheme) and line[0:3] == dwi_first_bzero_pe[0:3]: + se_epi_volume_to_remove = index + new_se_epi_path = os.path.splitext(se_epi_path)[0] + '_firstdwibzero.mif' + if (se_epi_pe_sum == [ 0, 0, 0 ]) and (se_epi_volume_to_remove < len(se_epi_pe_scheme)): + app.console('Balanced phase-encoding scheme detected in \'' + app.args.se_epi + '\'; volume ' + str(se_epi_volume_to_remove) + ' will be removed and replaced with first b=0 from DWIs') + run.command('mrconvert ' + se_epi_path + ' - -coord 3 ' + ','.join([str(index) for index in range(len(se_epi_pe_scheme)) if not index == se_epi_volume_to_remove]) + ' | mrcat dwi_first_bzero.mif - ' + new_se_epi_path + ' -axis 3') # Also need to update the phase-encoding scheme appropriately if it's being set manually # (if embedded within the image headers, should be updated through the command calls) - if topup_manual_pe_scheme: + if se_epi_manual_pe_scheme: first_line = list(manual_pe_dir) first_line.append(trt) - new_topup_manual_pe_scheme = [ ] - new_topup_manual_pe_scheme.append(first_line) - for index, entry in enumerate(topup_manual_pe_scheme): - if not index == topup_volume_to_remove: - new_topup_manual_pe_scheme.append(entry) - topup_manual_pe_scheme = new_topup_manual_pe_scheme + new_se_epi_manual_pe_scheme = [ ] + new_se_epi_manual_pe_scheme.append(first_line) + for index, entry in enumerate(se_epi_manual_pe_scheme): + if not index == se_epi_volume_to_remove: + new_se_epi_manual_pe_scheme.append(entry) + se_epi_manual_pe_scheme = new_se_epi_manual_pe_scheme else: - if topup_pe_sum == [ 0, 0, 0 ] and topup_volume_to_remove == len(topup_pe_scheme): + if se_epi_pe_sum == [ 0, 0, 0 ] and se_epi_volume_to_remove == len(se_epi_pe_scheme): app.console('Phase-encoding scheme of -se_epi image is balanced, but could not find appropriate volume with which to substitute first b=0 volume from DWIs; first b=0 DWI volume will be inserted to start of series, resulting in an unbalanced scheme') else: app.console('Unbalanced phase-encoding scheme detected in series provided via -se_epi option; first DWI b=0 volume will be inserted to start of series') - run.command('mrcat dwi_first_bzero.mif ' + topup_in_path + ' topup_in_dwibzero.mif -axis 3') + run.command('mrcat dwi_first_bzero.mif ' + se_epi_path + ' ' + new_se_epi_path + ' -axis 3') # Also need to update the phase-encoding scheme appropriately - if topup_manual_pe_scheme: + if se_epi_manual_pe_scheme: first_line = list(manual_pe_dir) first_line.append(trt) - topup_manual_pe_scheme = [ first_line, topup_manual_pe_scheme ] + se_epi_manual_pe_scheme = [ first_line, se_epi_manual_pe_scheme ] # Ended branching based on balanced-ness of PE acquisition scheme within SE-EPI volumes - file.delTemporary(topup_in_path) - topup_in_path = 'topup_in_dwibzero.mif' - + file.delTemporary(se_epi_path) + se_epi_path = new_se_epi_path + # Ended branching based on prior merge of SE-EPI and DWI b=0 volumes due to no phase-encoding contrast in SE-EPI # If the first b=0 volume in the DWIs is in fact not the volume (i.e. index zero), we're going to @@ -504,13 +507,13 @@ if app.args.se_epi: str(dwi_first_bzero_index) + \ ',0' + \ (':' + str(dwi_first_bzero_index-1) if dwi_first_bzero_index > 1 else '') + \ - (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < num_volumes-1 else '') + \ - (':' + str(num_volumes-1) if dwi_first_bzero_index < num_volumes-2 else '') + (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < dwi_num_volumes-1 else '') + \ + (':' + str(dwi_num_volumes-1) if dwi_first_bzero_index < dwi_num_volumes-2 else '') dwi_permute_volumes_post_eddy_option = ' -coord 3 1' + \ (':' + str(dwi_first_bzero_index) if dwi_first_bzero_index > 1 else '') + \ ',0' + \ - (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < num_volumes-1 else '') + \ - (':' + str(num_volumes-1) if dwi_first_bzero_index < num_volumes-2 else '') + (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < dwi_num_volumes-1 else '') + \ + (':' + str(dwi_num_volumes-1) if dwi_first_bzero_index < dwi_num_volumes-2 else '') # Completed checking for presence of b=0 image in DWIs @@ -522,8 +525,8 @@ elif not PE_design == 'None': # No SE EPI images explicitly provided: In some ca # Preferably also make sure that there's some phase-encoding contrast in there... # With -rpe_all, need to write inferred phase-encoding to file and import before using dwiextract so that the phase-encoding # of the extracted b=0's is propagated to the generated b=0 series - run.command('mrconvert dwi.mif' + import_dwi_pe_table_option + ' - | dwiextract - se_epi.mif -bzero') - se_epi_header = image.Header('se_epi.mif') + run.command('mrconvert dwi.mif' + import_dwi_pe_table_option + ' - | dwiextract - ' + se_epi_path + ' -bzero') + se_epi_header = image.Header(se_epi_path) # If there's no contrast remaining in the phase-encoding scheme, it'll be written to # PhaseEncodingDirection and TotalReadoutTime rather than pe_scheme @@ -534,17 +537,18 @@ elif not PE_design == 'None': # No SE EPI images explicitly provided: In some ca else: app.warn('DWI header indicates no phase encoding contrast between b=0 images; proceeding without inhomogeneity field estimation') do_topup = False - run.function(os.remove, 'se_epi.mif') + run.function(os.remove, se_epi_path) + se_epi_path = None se_epi_header = None # This may be required when setting up the topup call -import_topup_pe_table_option = '' -if topup_manual_pe_scheme: - with open('topup_manual_pe_scheme.txt', 'w') as f: - for line in topup_manual_pe_scheme: +import_se_epi_manual_pe_table_option = '' +if se_epi_manual_pe_scheme: + with open('se_epi_manual_pe_scheme.txt', 'w') as f: + for line in se_epi_manual_pe_scheme: f.write(' '.join([str(value) for value in line]) + '\n') - import_topup_pe_table_option = ' -import_pe_table topup_manual_pe_scheme.txt' + import_se_epi_manual_pe_table_option = ' -import_pe_table se_epi_manual_pe_scheme.txt' # Need gradient table if running dwi2mask after applytopup to derive a brain mask for eddy @@ -554,10 +558,9 @@ run.command('mrinfo dwi.mif -export_grad_mrtrix grad.b') eddy_in_topup_option = '' dwi_post_eddy_crop_option = '' -dwi_padded = 'dwi.mif' +dwi_path = 'dwi.mif' if do_topup: -<<<<<<< HEAD # topup will crash if its input image has a spatial dimension with a non-even size; # presumably due to a downsampling by a factor of 2 in a multi-resolution scheme # The newest eddy also requires the output from topup and the input DWIs to have the same size; @@ -565,9 +568,8 @@ if do_topup: # Rather than crop in this case (which would result in a cropped output image), # duplicate the last slice on any problematic axis, and then crop that extra # slice at the output step - # By this point, if the SE-EPI images and DWIs are not on the same image grid, the + # By this point, if the input SE-EPI images and DWIs are not on the same image grid, the # SE-EPI images have already been re-gridded to DWI image space; - # therefore 'topup_size' is out of date, and we need to test 'dwi_size' odd_axis_count = 0 for axis_size in dwi_header.size()[:3]: if int(axis_size%2): @@ -577,20 +579,19 @@ if do_topup: 'this will be automatically padded for compatibility with topup, and the extra slice' + ('s' if odd_axis_count > 1 else '') + ' erased afterwards') for axis, axis_size in enumerate(dwi_header.size()[:3]): if int(axis_size%2): - new_topup_in_path = os.path.splitext(topup_in_path)[0] + '_pad' + str(axis) + '.mif' - run.command('mrconvert ' + topup_in_path + ' -coord ' + str(axis) + ' ' + str(axis_size-1) + ' - | mrcat ' + topup_in_path + ' - ' + new_topup_in_path + ' -axis ' + str(axis)) - file.delTemporary(topup_in_path) - topup_in_path = new_topup_in_path - new_dwi_padded = os.path.splitext(dwi_padded)[0] + '_pad' + str(axis) + '.mif' - run.command('mrconvert ' + dwi_padded + ' -coord ' + str(axis) + ' ' + str(axis_size-1) + ' - | mrcat ' + dwi_padded + ' - ' + new_dwi_padded + ' - axis ' + str(axis)) - file.delTemporary(dwi_padded) - dwi_padded = new_dwi_padded + new_se_epi_path = os.path.splitext(se_epi_path)[0] + '_pad' + str(axis) + '.mif' + run.command('mrconvert ' + se_epi_path + ' -coord ' + str(axis) + ' ' + str(axis_size-1) + ' - | mrcat ' + se_epi_path + ' - ' + new_se_epi_path + ' -axis ' + str(axis)) + file.delTemporary(se_epi_path) + se_epi_path = new_se_epi_path + new_dwi_path = os.path.splitext(dwi_path)[0] + '_pad' + str(axis) + '.mif' + run.command('mrconvert ' + dwi_path + ' -coord ' + str(axis) + ' ' + str(axis_size-1) + ' - | mrcat ' + dwi_path + ' - ' + new_dwi_path + ' - axis ' + str(axis)) + file.delTemporary(dwi_path) + dwi_path = new_dwi_path dwi_post_eddy_crop_option += ' -coord ' + str(axis) + ' 0:' + str(axis_size-1) - # Do the conversion in preparation for topup - run.command('mrconvert ' + topup_in_path + ' topup_in.nii' + import_topup_pe_table_option + ' -stride -1,+2,+3,+4 -export_pe_table topup_datain.txt') - file.delTemporary(topup_in_path) + run.command('mrconvert ' + se_epi_path + ' topup_in.nii' + import_se_epi_manual_pe_table_option + ' -stride -1,+2,+3,+4 -export_pe_table topup_datain.txt') + file.delTemporary(se_epi_path) # Run topup topup_manual_options = '' @@ -602,9 +603,9 @@ if do_topup: # applytopup can't receive the complete DWI input and correct it as a whole, because the phase-encoding # details may vary between volumes if dwi_manual_pe_scheme: - run.command('mrconvert ' + dwi_padded + import_dwi_pe_table_option + ' - | mrinfo - -export_pe_eddy applytopup_config.txt applytopup_indices.txt') + run.command('mrconvert ' + dwi_path + import_dwi_pe_table_option + ' - | mrinfo - -export_pe_eddy applytopup_config.txt applytopup_indices.txt') else: - run.command('mrinfo ' + dwi_padded + ' -export_pe_eddy applytopup_config.txt applytopup_indices.txt') + run.command('mrinfo ' + dwi_path + ' -export_pe_eddy applytopup_config.txt applytopup_indices.txt') # Update: Call applytopup separately for each unique phase-encoding # This should be the most compatible option with more complex phase-encoding acquisition designs, @@ -616,9 +617,9 @@ if do_topup: for line in f: input_path = 'dwi_pe_' + str(index) + '.nii' json_path = 'dwi_pe_' + str(index) + '.json' - temp_path = 'dwi_pe_' + str(index) + '_topup' + fsl_suffix - output_path = 'dwi_pe_' + str(index) + '_topup.mif' - run.command('dwiextract ' + dwi_padded + ' ' + import_dwi_pe_table_option + ' -pe ' + ','.join(line.split()) + ' - | mrconvert - ' + input_path + ' -json_export ' + json_path) + temp_path = 'dwi_pe_' + str(index) + '_applytopup' + fsl_suffix + output_path = 'dwi_pe_' + str(index) + '_applytopup.mif' + run.command('dwiextract ' + dwi_path + ' ' + import_dwi_pe_table_option + ' -pe ' + ','.join(line.split()) + ' - | mrconvert - ' + input_path + ' -json_export ' + json_path) run.command(applytopup_cmd + ' --imain=' + input_path + ' --datain=applytopup_config.txt --inindex=' + str(index) + ' --topup=field --out=' + temp_path + ' --method=jac') file.delTemporary(input_path) temp_path = fsl.findImage(temp_path) @@ -629,10 +630,7 @@ if do_topup: index += 1 # Use the initial corrected volumes to derive a brain mask for eddy - if len(applytopup_image_list) == 1: - run.command('dwi2mask ' + applytopup_image_list[0] + ' - | maskfilter - dilate - | mrconvert - mask.nii -datatype float32 -stride -1,+2,+3') - else: - run.command('mrcat ' + ' '.join(applytopup_image_list) + ' - | dwi2mask - - | maskfilter - dilate - | mrconvert - mask.nii -datatype float32 -stride -1,+2,+3') + run.command('mrcat ' + ' '.join(applytopup_image_list) + ' - | dwi2mask - - | maskfilter - dilate - | mrconvert - mask.nii -datatype float32 -stride -1,+2,+3') for entry in applytopup_image_list: file.delTemporary(entry) @@ -642,13 +640,13 @@ if do_topup: else: # Generate a processing mask for eddy based on the uncorrected input DWIs - run.command('dwi2mask ' + dwi_padded + ' - | maskfilter - dilate - | mrconvert - mask.nii -datatype float32 -stride -1,+2,+3') + run.command('dwi2mask ' + dwi_path + ' - | maskfilter - dilate - | mrconvert - mask.nii -datatype float32 -stride -1,+2,+3') # Run eddy -run.command('mrconvert ' + dwi_padded + import_dwi_pe_table_option + dwi_permute_volumes_pre_eddy_option + ' dwi.nii -stride -1,+2,+3,+4 -export_grad_fsl bvecs bvals -export_pe_eddy eddy_config.txt eddy_indices.txt') -file.delTemporary(dwi_padded) +run.command('mrconvert ' + dwi_path + import_dwi_pe_table_option + dwi_permute_volumes_pre_eddy_option + ' dwi.nii -stride -1,+2,+3,+4 -export_grad_fsl bvecs bvals -export_pe_eddy eddy_config.txt eddy_indices.txt') +file.delTemporary(dwi_path) eddy_manual_options = '' if app.args.eddy_options: eddy_manual_options = ' ' + app.args.eddy_options.strip() @@ -674,13 +672,13 @@ if not os.path.isfile(bvecs_path): # This could be either due to use of -rpe_all option, or just due to the data provided with -rpe_header # Rather than trying to re-use the code that was used in the case of -rpe_all, run fresh code # The phase-encoding scheme needs to be checked also -volume_matchings = [ num_volumes ] * num_volumes +volume_matchings = [ dwi_num_volumes ] * dwi_num_volumes volume_pairs = [ ] -app.debug('Commencing gradient direction matching; ' + str(num_volumes) + ' volumes') -for index1 in range(num_volumes): - if volume_matchings[index1] == num_volumes: # As yet unpaired - for index2 in range(index1+1, num_volumes): - if volume_matchings[index2] == num_volumes: # Also as yet unpaired +app.debug('Commencing gradient direction matching; ' + str(dwi_num_volumes) + ' volumes') +for index1 in range(dwi_num_volumes): + if volume_matchings[index1] == dwi_num_volumes: # As yet unpaired + for index2 in range(index1+1, dwi_num_volumes): + if volume_matchings[index2] == dwi_num_volumes: # Also as yet unpaired # Here, need to check both gradient matching and reversed phase-encode direction if not any(dwi_pe_scheme[index1][i] + dwi_pe_scheme[index2][i] for i in range(0,3)) and grads_match(grad[index1], grad[index2]): volume_matchings[index1] = index2 @@ -692,7 +690,7 @@ for index1 in range(num_volumes): break -if not len(volume_pairs) == int(num_volumes/2): +if not len(volume_pairs) == int(dwi_num_volumes/2): # Convert the resulting volume to the output image, and re-insert the diffusion encoding run.command('mrconvert ' + fsl.findImage('dwi_post_eddy') + ' result.mif' + dwi_permute_volumes_post_eddy_option + dwi_post_eddy_crop_option + stride_option + ' -fslgrad ' + bvecs_path + ' bvals') @@ -741,7 +739,7 @@ else: with open('bvecs_combined', 'w') as f: for axis in range(0, 3): axis_data = [ ] - for volume in range(0, int(num_volumes/2)): + for volume in range(0, int(dwi_num_volumes/2)): axis_data.append(str(bvecs_combined_transpose[volume][axis])) f.write(' '.join(axis_data) + '\n') @@ -758,9 +756,10 @@ else: field_map_image = fsl.findImage('field_map') if not image.match('topup_in.nii', field_map_image): app.warn('topup output field image has erroneous header; recommend updating FSL to version 5.0.8 or later') - run.command('mrtransform ' + field_map_image + ' -replace topup_in.nii field_map_fix.mif') + new_field_map_image = 'field_map_fix.mif' + run.command('mrtransform ' + field_map_image + ' -replace topup_in.nii ' + new_field_map_image) file.delTemporary(field_map_image) - field_map_image = 'field_map_fix.mif' + field_map_image = new_field_map_image file.delTemporary('topup_in.nii') @@ -796,34 +795,35 @@ else: # convert it to an uncompressed format before we do anything with it. eddy_output = fsl.findImage('dwi_post_eddy') if eddy_output.endswith('.gz'): - run.command('mrconvert ' + eddy_output + ' dwi_post_eddy.nii') + new_eddy_output = 'dwi_post_eddy_uncompressed.mif' + run.command('mrconvert ' + eddy_output + ' ' + new_eddy_output) file.delTemporary(eddy_output) - eddy_output = 'dwi_post_eddy.nii' + eddy_output = new_eddy_output # If the DWI volumes were permuted prior to running eddy, then the simplest approach is to permute them # back to their original positions; otherwise, the stored gradient vector directions / phase encode # directions / matched volume pairs are no longer appropriate - volume_recombination_input = 'dwi_post_eddy' + fsl_suffix if dwi_permute_volumes_post_eddy_option: - run.command('mrconvert ' + volume_recombination_input + dwi_permute_volumes_post_eddy_option + 'dwi_post_eddy.mif') - file.delTempFile(volume_recombination_input) - volume_recombination_input = 'dwi_post_eddy.mif' + new_eddy_output = os.path.splitext(eddy_output)[0] + '_volpermuteundo.mif' + run.command('mrconvert ' + eddy_output + dwi_permute_volumes_post_eddy_option + ' ' + new_eddy_output) + file.delTemporary(eddy_output) + eddy_output = new_eddy_output # This section extracts the two volumes corresponding to each reversed phase-encoded volume pair, and # derives a single image volume based on the recombination equation combined_image_list = [ ] for index, volumes in enumerate(volume_pairs): pe_indices = [ eddy_indices[i] for i in volumes ] - run.command('mrconvert ' + volume_recombination_input + ' volume0.mif -coord 3 ' + str(volumes[0])) - run.command('mrconvert ' + volume_recombination_input + ' volume1.mif -coord 3 ' + str(volumes[1])) + run.command('mrconvert ' + eddy_output + ' volume0.mif -coord 3 ' + str(volumes[0])) + run.command('mrconvert ' + eddy_output + ' volume1.mif -coord 3 ' + str(volumes[1])) # Volume recombination equation described in Skare and Bammer 2010 - run.command('mrcalc volume0.mif weight' + str(pe_indices[0]) + '.mif -mult volume1.mif weight' + str(pe_indices[1]) + '.mif -mult -add weight' + str(pe_indices[0]) + '.mif weight' + str(pe_indices[1]) + '.mif -add -divide 0.0 -max combined' + str(index) + '.mif') - combined_image_list.append('combined' + str(index) + '.mif') + combined_image_path = 'combined' + str(index) + '.mif' + run.command('mrcalc volume0.mif weight' + str(pe_indices[0]) + '.mif -mult volume1.mif weight' + str(pe_indices[1]) + '.mif -mult -add weight' + str(pe_indices[0]) + '.mif weight' + str(pe_indices[1]) + '.mif -add -divide 0.0 -max ' + combined_image_path) + combined_image_list.append(combined_image_path) run.function(os.remove, 'volume0.mif') run.function(os.remove, 'volume1.mif') - file.delTemporary(eddy_output) - file.delTempFile(volume_recombination_input) + file.delTemporary(eddy_output) for index in range(0, len(eddy_config)): file.delTemporary('weight' + str(index+1) + '.mif') @@ -833,7 +833,8 @@ else: file.delTemporary(entry) -# TODO Should header key-values only in place for the purposes of pre-processing (i.e. TE, TR, flip angle, in-plane acceleration) be erased? +# Should header key-values only in place for the purposes of pre-processing (i.e. TE, TR, flip angle, in-plane acceleration) be erased? + # Finish! run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + grad_export_option + (' -force' if app.forceOverwrite else '')) diff --git a/lib/mrtrix3/image.py b/lib/mrtrix3/image.py index 4ec66d0e6a..fe82be9f11 100644 --- a/lib/mrtrix3/image.py +++ b/lib/mrtrix3/image.py @@ -125,10 +125,10 @@ def match(image_one, image_two, max_dim=0): #pylint: disable=unused-variable max_dim = len(image_one.size()) # Image dimensions if not image_one.size()[:max_dim] == image_two.size()[:max_dim]: - app.debug(debug_prefix + ' axis size mismatch (' + str(iamge_one.size()) + ' ' + str(image_two.size()) + ')') + app.debug(debug_prefix + ' axis size mismatch (' + str(image_one.size()) + ' ' + str(image_two.size()) + ')') return False # Voxel size - for one, two in zip(image_one.spacing()[:max_dim], iamge_two.spacing()[:max_dim]): + for one, two in zip(image_one.spacing()[:max_dim], image_two.spacing()[:max_dim]): if one and two and not math.isnan(one) and not math.isnan(two): if (abs(two-one) / (0.5*(one+two))) > 1e-04: app.debug(debug_prefix + ' voxel size mismatch (' + str(image_one.spacing()) + ' ' + str(image_two.spacing()) + ')') From d1f5c7399d9ab99e90995a4bfd540a51a7ad9cd4 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 2 Oct 2017 23:08:36 +1100 Subject: [PATCH 170/538] mrtrix3.path.allindir(): Fix detection of hidden files on Windows --- lib/mrtrix3/app.py | 2 +- lib/mrtrix3/path.py | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index 9545b7a7c8..d38ce688ae 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -832,7 +832,7 @@ def done(self): def isWindows(): #pylint: disable=unused-variable import platform system = platform.system().lower() - return system.startswith('mingw') or system.startswith('msys') or system.startswith('windows') + return system.startswith('mingw') or system.startswith('msys') or system.startswith('nt') or system.startswith('windows') diff --git a/lib/mrtrix3/path.py b/lib/mrtrix3/path.py index 2b09d74f0d..a265261599 100644 --- a/lib/mrtrix3/path.py +++ b/lib/mrtrix3/path.py @@ -21,15 +21,19 @@ def commonPostfix(inputFiles): #pylint: disable=unused-variable # List the content of a directory def allindir(directory, dir_path=True, ignore_hidden_files=True): #pylint: disable=unused-variable - import os + import ctypes, os + from mrtrix3 import app def is_hidden(directory, filename): - if os.name == 'nt': - import win32api, win32con #pylint: disable=import-error - attribute = win32api.GetFileAttributes(os.path.join(directory, filename)) - return attribute & (win32con.FILE_ATTRIBUTE_HIDDEN | win32con.FILE_ATTRIBUTE_SYSTEM) + if app.isWindows(): + try: + attrs = ctypes.windll.kernel32.GetFileAttributesW(unicode(os.path.join(directory, filename))) + assert attrs != -1 + return bool(attrs & 2) + except (AttributeError, AssertionError): + return False return filename.startswith('.') - flist = sorted([filename for filename in os.listdir(directory) if not ignore_hidden_files or not is_hidden (directory, filename) ]) + flist = sorted([filename for filename in os.listdir(directory) if not ignore_hidden_files or not is_hidden(directory, filename) ]) if dir_path: return [ os.path.join(directory, filename) for filename in flist ] return flist From 4b412dcbf4c3231561a47ff4be52993171004f13 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Mon, 2 Oct 2017 14:26:13 +0100 Subject: [PATCH 171/538] tcknormalise: skip vertices if outside warp This occurs when streamlines venture outside the deformation field, and causes additional empty streamlines to show up in output. As discussed in http://community.mrtrix.org/t/bug-in-tcknormalise-when-using-warpcorrect/1175 and #1131. --- cmd/tcknormalise.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/tcknormalise.cpp b/cmd/tcknormalise.cpp index c36120e390..9d4f0db85d 100644 --- a/cmd/tcknormalise.cpp +++ b/cmd/tcknormalise.cpp @@ -65,9 +65,12 @@ class Warper { MEMALIGN(Warper) interp (warp) { } bool operator () (const TrackType& in, TrackType& out) { - out.resize (in.size()); - for (size_t n = 0; n < in.size(); ++n) - out[n] = pos(in[n]); + out.clear(); + for (size_t n = 0; n < in.size(); ++n) { + auto vertex = pos(in[n]); + if (vertex.allFinite()) + out.push_back (vertex); + } return true; } From 8e5b83f20778f468b7ac4da57259cf5cb5a7cce3 Mon Sep 17 00:00:00 2001 From: Max Pietsch Date: Mon, 2 Oct 2017 16:20:53 +0100 Subject: [PATCH 172/538] lib/mrtrix3/path.py: replaced unicode for python3 compatiblity --- lib/mrtrix3/path.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mrtrix3/path.py b/lib/mrtrix3/path.py index a265261599..a60093e14e 100644 --- a/lib/mrtrix3/path.py +++ b/lib/mrtrix3/path.py @@ -26,7 +26,7 @@ def allindir(directory, dir_path=True, ignore_hidden_files=True): #pylint: disab def is_hidden(directory, filename): if app.isWindows(): try: - attrs = ctypes.windll.kernel32.GetFileAttributesW(unicode(os.path.join(directory, filename))) + attrs = ctypes.windll.kernel32.GetFileAttributesW(u"%s" % str(os.path.join(directory, filename))) assert attrs != -1 return bool(attrs & 2) except (AttributeError, AssertionError): From 4c4d7f09e464cee7ff5acff8b84734a64ca04399 Mon Sep 17 00:00:00 2001 From: Max Pietsch Date: Tue, 3 Oct 2017 13:28:46 +0100 Subject: [PATCH 173/538] path.py: file starting with . is also hidden on windows --- lib/mrtrix3/path.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mrtrix3/path.py b/lib/mrtrix3/path.py index a60093e14e..2773334fa1 100644 --- a/lib/mrtrix3/path.py +++ b/lib/mrtrix3/path.py @@ -30,7 +30,7 @@ def is_hidden(directory, filename): assert attrs != -1 return bool(attrs & 2) except (AttributeError, AssertionError): - return False + return filename.startswith('.') return filename.startswith('.') flist = sorted([filename for filename in os.listdir(directory) if not ignore_hidden_files or not is_hidden(directory, filename) ]) From 01059bc7d5b6047113ca4751fb5e8c613a7ce702 Mon Sep 17 00:00:00 2001 From: Lestropie Date: Wed, 4 Oct 2017 17:46:33 +1100 Subject: [PATCH 174/538] dwipreproc: Fixes for -align_seepi option - In cases where the SE-EPI series has no phase-encoding contrast, and therefore the DWI b=0 volumes are merged with it, ensure that the appropriate components are and are not executed; e.g. check the TE / TR / flip angle, and check to see if DWI volume permitation is necessary (if the first b=0 volume is not the first volume), but don't perform an additional extraction of the first b=0 image. - Fix generation of mask from applytopup output depending on whether there is more than one phase-encoding direction present in the input DWIs. - image.match(): Apply less stringent threshold to translation component of transform matrix than that applied to the rotation component. --- bin/dwipreproc | 124 ++++++++++++++++++++++++------------------- lib/mrtrix3/image.py | 7 ++- 2 files changed, 74 insertions(+), 57 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 2f47532772..a4dce489b0 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -314,7 +314,7 @@ else: if not manual_pe_dir: app.error('No phase encoding information provided either in header or at command-line') if dwi_auto_trt_warning: - app.warn('Total readout time not provided at command-line; assuming sane default of ' + str(auto_trt)) + app.console('Total readout time not provided at command-line; assuming sane default of ' + str(auto_trt)) dwi_pe_scheme = dwi_manual_pe_scheme # May be needed later for triggering volume recombination # This may be required by -rpe_all for extracting b=0 volumes while retaining phase-encoding information @@ -400,6 +400,7 @@ if app.args.se_epi: if app.args.align_seepi: app.console('No phase-encoding contrast present in SE-EPI images; will examine again after combining with DWI b=0 images') new_se_epi_path = os.path.splitext(se_epi_path)[0] + '_dwibzeros.mif' + # TODO Should a balanced scheme be produced if possible? run.command('dwiextract dwi.mif - -bzero | mrcat - se_epi.mif ' + new_se_epi_path + ' -axis 3') se_epi_header = image.Header(new_se_epi_path) se_epi_pe_scheme_has_contrast = 'pe_scheme' in se_epi_header.keyval() @@ -408,6 +409,8 @@ if app.args.se_epi: se_epi_path = new_se_epi_path se_epi_pe_scheme = phaseEncoding.getScheme(se_epi_header) dwi_bzero_added_to_se_epi = True + # Delay testing appropriateness of the concatenation of these images + # (i.e. differences in contrast) to later else: app.error('No phase-encoding contrast present in SE-EPI images, even after concatenating with b=0 images due to -align_seepi option; ' 'cannot perform inhomogeneity field estimation') @@ -416,9 +419,40 @@ if app.args.se_epi: if app.args.align_seepi: + dwi_te = dwi_header.keyval().get('EchoTime') + se_epi_te = se_epi_header.keyval().get('EchoTime') + if dwi_te and se_epi_te and dwi_te != se_epi_te: + app.warn('It appears that the spin-echo EPI images used for inhomogeneity field estimation have a different echo time to the DWIs being corrected. ' + 'This may cause issues in estimation of the field, as the first DWI b=0 volume will be added to the input series to topup ' + 'due to use of the -align_seepi option.') + + dwi_tr = dwi_header.keyval().get('RepetitionTime') + se_epi_tr = se_epi_header.keyval().get('RepetitionTime') + if dwi_tr and se_epi_tr and dwi_tr != se_epi_tr: + app.warn('It appears that the spin-echo EPI images used for inhomogeneity field estimation have a different repetition time to the DWIs being corrected. ' + 'This may cause issues in estimation of the field, as the first DWI b=0 volume will be added to the input series to topup ' + 'due to use of the -align_seepi option.') + + dwi_flip = dwi_header.keyval().get('FlipAngle') + se_epi_flip = se_epi_header.keyval().get('FlipAngle') + if dwi_flip and se_epi_flip and dwi_flip != se_epi_flip: + app.warn('It appears that the spin-echo EPI images used for inhomogeneity field estimation have a different flip angle to the DWIs being corrected. ' + 'This may cause issues in estimation of the field, as the first DWI b=0 volume will be added to the input series to topup ' + 'due to use of the -align_seepi option.') + # If we are using the -se_epi option, and hence the input images to topup have not come from the DWIs themselves, # we need to insert the first b=0 DWI volume to the start of the topup input image. Otherwise, the field estimated # by topup will not be correctly aligned with the volumes as they are processed by eddy. + # + # However, there's also a code path by which we may have already performed this addition. + # If we have already apliced the b=0 volumes from the DWI input with the SE-EPI image + # (due to the absence of phase-encoding contrast in the SE-EPI series), we don't want to + # re-attempt such a concatenation; the fact that the DWI b=0 images were inserted ahead of + # the SE-EPI images means the alignment issue should be dealt with. + # Note however that in this instance it may still be necessary to permute the volumes within the + # DWI series if the first volume is not a b=0 volume; but the first b=0 volume will inherently + # already be the first volume in the input to topup + bzero_threshold = 10.0 if 'BZeroThreshold' in app.config: bzero_threshold = float(app.config['BZeroThreshold']) @@ -427,41 +461,37 @@ if app.args.se_epi: if line[3] <= bzero_threshold: break dwi_first_bzero_index += 1 - if dwi_first_bzero_index == len(grad): + if dwi_first_bzero_index == len(grad) and not dwi_bzero_added_to_se_epi: app.warn('Unable to find b=0 volume in input DWIs to provide alignment between topup and eddy; script will proceed as though the -align_seepi option were not provided') else: - run.command('mrconvert dwi.mif dwi_first_bzero.mif -coord 3 ' + str(dwi_first_bzero_index) + ' -axes 0,1,2') - dwi_first_bzero_pe = dwi_manual_pe_scheme[dwi_first_bzero_index] if overwrite_dwi_pe_scheme else dwi_pe_scheme[dwi_first_bzero_index] - - dwi_te = dwi_header.keyval().get('EchoTime') - se_epi_te = se_epi_header.keyval().get('EchoTime') - if dwi_te and se_epi_te and dwi_te != se_epi_te: - app.warn('It appears that the spin-echo EPI images used for inhomogeneity field estimation have a different echo time to the DWIs being corrected. ' - 'This may cause issues in estimation of the field, as the first DWI b=0 volume will be added to the input series to topup ' - 'due to use of the -align_seepi option.') - - dwi_tr = dwi_header.keyval().get('RepetitionTime') - se_epi_tr = se_epi_header.keyval().get('RepetitionTime') - if dwi_tr and se_epi_tr and dwi_tr != se_epi_tr: - app.warn('It appears that the spin-echo EPI images used for inhomogeneity field estimation have a different repetition time to the DWIs being corrected. ' - 'This may cause issues in estimation of the field, as the first DWI b=0 volume will be added to the input series to topup ' - 'due to use of the -align_seepi option.') - - dwi_flip = dwi_header.keyval().get('FlipAngle') - se_epi_flip = se_epi_header.keyval().get('FlipAngle') - if dwi_flip and se_epi_flip and dwi_flip != se_epi_flip: - app.warn('It appears that the spin-echo EPI images used for inhomogeneity field estimation have a different flip angle to the DWIs being corrected. ' - 'This may cause issues in estimation of the field, as the first DWI b=0 volume will be added to the input series to topup ' - 'due to use of the -align_seepi option.') - - # If we have already apliced the b=0 volumes from the DWI input with the SE-EPI image - # (due to the absence of phase-encoding contrast in the SE-EPI series), we don't want to - # re-attempt such a concatenation; the fact that the DWI b=0 images were inserted ahead of - # the SE-EPI images means the alignment issue should be dealt with. - # Note however that in this instance it may still be necessary to permute the volumes within the - # DWI series if the first volume is not a b=0 volume; but the first b=0 volume will inherently - # already be the first volume in the input to topup + + # If the first b=0 volume in the DWIs is in fact not the volume (i.e. index zero), we're going to + # manually place it at the start of the DWI volumes when they are input to eddy, so that the + # first input volume to topup and the first input volume to eddy are one and the same. + # Note: If at a later date, the statistical outputs from eddy are considered (e.g. motion, outliers), + # then this volume permutation will need to be taken into account + if dwi_first_bzero_index: + app.console('First b=0 volume in input DWIs is volume index ' + str(dwi_first_bzero_index) + '; ' + 'this will be permuted to be the first volume (index 0) when eddy is run') + dwi_permute_volumes_pre_eddy_option = ' -coord 3 ' + \ + str(dwi_first_bzero_index) + \ + ',0' + \ + (':' + str(dwi_first_bzero_index-1) if dwi_first_bzero_index > 1 else '') + \ + (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < dwi_num_volumes-1 else '') + \ + (':' + str(dwi_num_volumes-1) if dwi_first_bzero_index < dwi_num_volumes-2 else '') + dwi_permute_volumes_post_eddy_option = ' -coord 3 1' + \ + (':' + str(dwi_first_bzero_index) if dwi_first_bzero_index > 1 else '') + \ + ',0' + \ + (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < dwi_num_volumes-1 else '') + \ + (':' + str(dwi_num_volumes-1) if dwi_first_bzero_index < dwi_num_volumes-2 else '') + + # If b=0 volumes from the DWIs have already been added to the SE-EPI image due to an + # absence of phase-encoding contrast in the latter, we don't need to perform the following if not dwi_bzero_added_to_se_epi: + + run.command('mrconvert dwi.mif dwi_first_bzero.mif -coord 3 ' + str(dwi_first_bzero_index) + ' -axes 0,1,2') + dwi_first_bzero_pe = dwi_manual_pe_scheme[dwi_first_bzero_index] if overwrite_dwi_pe_scheme else dwi_pe_scheme[dwi_first_bzero_index] + se_epi_pe_sum = [ 0, 0, 0 ] se_epi_volume_to_remove = len(se_epi_pe_scheme) for index, line in enumerate(se_epi_pe_scheme): @@ -501,28 +531,9 @@ if app.args.se_epi: # Ended branching based on prior merge of SE-EPI and DWI b=0 volumes due to no phase-encoding contrast in SE-EPI - # If the first b=0 volume in the DWIs is in fact not the volume (i.e. index zero), we're going to - # manually place it at the start of the DWI volumes when they are input to eddy, so that the - # first input volume to topup and the first input volume to eddy are one and the same. - # Note: If at a later date, the statistical outputs from eddy are considered (e.g. motion, outliers), - # then this volume permutation will need to be taken into account - if dwi_first_bzero_index: - app.console('First b=0 volume in input DWIs is volume index ' + str(dwi_first_bzero_index) + '; ' - 'this will be permuted to be the first volume (index 0) when eddy is run') - dwi_permute_volumes_pre_eddy_option = ' -coord 3 ' + \ - str(dwi_first_bzero_index) + \ - ',0' + \ - (':' + str(dwi_first_bzero_index-1) if dwi_first_bzero_index > 1 else '') + \ - (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < dwi_num_volumes-1 else '') + \ - (':' + str(dwi_num_volumes-1) if dwi_first_bzero_index < dwi_num_volumes-2 else '') - dwi_permute_volumes_post_eddy_option = ' -coord 3 1' + \ - (':' + str(dwi_first_bzero_index) if dwi_first_bzero_index > 1 else '') + \ - ',0' + \ - (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < dwi_num_volumes-1 else '') + \ - (':' + str(dwi_num_volumes-1) if dwi_first_bzero_index < dwi_num_volumes-2 else '') - # Completed checking for presence of b=0 image in DWIs + # Completed checking for presence of -se_epi option elif not PE_design == 'None': # No SE EPI images explicitly provided: In some cases, can extract appropriate b=0 images from DWI @@ -625,7 +636,7 @@ if do_topup: json_path = 'dwi_pe_' + str(index) + '.json' temp_path = 'dwi_pe_' + str(index) + '_applytopup' + fsl_suffix output_path = 'dwi_pe_' + str(index) + '_applytopup.mif' - run.command('dwiextract ' + dwi_path + ' ' + import_dwi_pe_table_option + ' -pe ' + ','.join(line.split()) + ' - | mrconvert - ' + input_path + ' -json_export ' + json_path) + run.command('dwiextract ' + dwi_path + import_dwi_pe_table_option + ' -pe ' + ','.join(line.split()) + ' - | mrconvert - ' + input_path + ' -json_export ' + json_path) run.command(applytopup_cmd + ' --imain=' + input_path + ' --datain=applytopup_config.txt --inindex=' + str(index) + ' --topup=field --out=' + temp_path + ' --method=jac') file.delTemporary(input_path) temp_path = fsl.findImage(temp_path) @@ -636,7 +647,10 @@ if do_topup: index += 1 # Use the initial corrected volumes to derive a brain mask for eddy - run.command('mrcat ' + ' '.join(applytopup_image_list) + ' - | dwi2mask - - | maskfilter - dilate - | mrconvert - mask.nii -datatype float32 -stride -1,+2,+3') + if len(applytopup_image_list) == 1: + run.command('dwi2mask ' + applytopup_image_list[0] + ' - | maskfilter - dilate - | mrconvert - mask.nii -datatype float32 -stride -1,+2,+3') + else: + run.command('mrcat ' + ' '.join(applytopup_image_list) + ' - -axis 3 | dwi2mask - - | maskfilter - dilate - | mrconvert - mask.nii -datatype float32 -stride -1,+2,+3') for entry in applytopup_image_list: file.delTemporary(entry) diff --git a/lib/mrtrix3/image.py b/lib/mrtrix3/image.py index c3eb3840e4..8365250464 100644 --- a/lib/mrtrix3/image.py +++ b/lib/mrtrix3/image.py @@ -139,10 +139,13 @@ def match(image_one, image_two, max_dim=0): #pylint: disable=unused-variable return False # Image transform for line_one, line_two in zip(image_one.transform(), image_two.transform()): - for one, two in zip(line_one, line_two): + for one, two in zip(line_one[:3], line_two[:3]): if abs(one-two) > 1e-4: - app.debug(debug_prefix + ' transform mismatch (' + str(image_one.transform()) + ' ' + str(image_two.transform()) + ')') + app.debug(debug_prefix + ' transform (rotation) mismatch (' + str(image_one.transform()) + ' ' + str(image_two.transform()) + ')') return False + if abs(line_one[3]-line_two[3]) > 1e-2: + app.debug(debug_prefix + ' transform (translation) mismatch (' + str(image_one.transform()) + ' ' + str(image_two.transform()) + ')') + return False # Everything matches! app.debug(debug_prefix + ' image match') return True From 1e960285d9be604466b70a8513162fa79b4e0e4b Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Mon, 2 Oct 2017 16:49:53 +0100 Subject: [PATCH 175/538] dirstat: add support for reporting from image and add options for more fine-grained queries --- cmd/dirstat.cpp | 307 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 233 insertions(+), 74 deletions(-) diff --git a/cmd/dirstat.cpp b/cmd/dirstat.cpp index 960de4b7b4..727c71a647 100644 --- a/cmd/dirstat.cpp +++ b/cmd/dirstat.cpp @@ -14,8 +14,10 @@ #include "command.h" #include "progressbar.h" +#include "header.h" #include "dwi/directions/file.h" #include "dwi/gradient.h" +#include "dwi/shells.h" @@ -29,121 +31,278 @@ void usage () SYNOPSIS = "Report statistics on a direction set"; ARGUMENTS - + Argument ("dirs", "the text file containing the directions.").type_file_in(); + + Argument ("dirs", "the text file or image containing the directions.").type_file_in(); + + OPTIONS + + OptionGroup ("Output options") + + Option ("bipolar", "output statistics for bipolar electrostatic repulsion model") + + Option ("unipolar", "output statistics for unipolar electrostatic repulsion model") + + Option ("shfit", "output statistics for spherical harmonics fit") + + Option ("symmetry", "output measure of symmetry of spherical coverage (as given by the norm of mean direction vector). This is important to ensure minimal bias due to eddy-currents.") + + Option ("nearest_neighour", "output nearest-neighbour angle statistics") + + Option ("energy", "output energy statistics") + + Option ("total", "output total of statistic (affects -energy only)") + + Option ("mean", "output mean of statistic (affects -nearest_neighbour or -energy only)") + + Option ("range", "output range of statistic (affects -nearest_neighbour or -energy only)") + + DWI::GradImportOptions() + + DWI::ShellOption; } int precision = 6; +void report (const std::string& title, Eigen::MatrixXd& directions); +bool bipolar = false; +bool unipolar = false; +bool shfit = false; +bool nearest_neighour = false; +bool energy = false; +bool symmetry = false; +bool total = false; +bool mean = false; +bool range = false; -void report (const std::string& title, const Eigen::MatrixXd& directions) + +void run () { - vector NN_bipolar (directions.rows(), -1.0); - vector NN_unipolar (directions.rows(), -1.0); + bipolar = get_options ("bipolar").size(); + unipolar = get_options ("unipolar").size(); + shfit = get_options ("shfit").size(); + symmetry = get_options ("symmetry").size(); + nearest_neighour = get_options ("nearest_neighour").size(); + energy = get_options ("energy").size(); + total = get_options ("total").size(); + mean = get_options ("mean").size(); + range = get_options ("range").size(); + + + if (!(bipolar | unipolar | shfit | symmetry)) + bipolar = unipolar = shfit = symmetry = true; - vector E_bipolar (directions.rows(), 0.0); - vector E_unipolar (directions.rows(), 0.0); + if (!(nearest_neighour | energy)) + nearest_neighour = energy = true; - for (ssize_t i = 0; i < directions.rows()-1; ++i) { - for (ssize_t j = i+1; j < directions.rows(); ++j) { - double cos_angle = directions.row(i).head(3).normalized().dot (directions.row(j).head(3).normalized()); - NN_unipolar[i] = std::max (NN_unipolar[i], cos_angle); - NN_unipolar[j] = std::max (NN_unipolar[j], cos_angle); - cos_angle = std::abs (cos_angle); - NN_bipolar[i] = std::max (NN_bipolar[i], cos_angle); - NN_bipolar[j] = std::max (NN_bipolar[j], cos_angle); + if (!(total | mean | range)) + total = mean = range = true; - double E = 1.0 / (directions.row(i).head(3) - directions.row(j).head(3)).norm(); + Eigen::MatrixXd directions; - E_unipolar[i] += E; - E_unipolar[j] += E; + try { + directions = DWI::Directions::load_cartesian (argument[0]); + } + catch (Exception& E) { + try { + directions = load_matrix (argument[0]); + } + catch (Exception& E) { + auto header = Header::open (argument[0]); + directions = DWI::get_valid_DW_scheme (header); + } + } - E += 1.0 / (directions.row(i).head(3) + directions.row(j).head(3)).norm(); + if (directions.cols() >= 4) { + auto shells = DWI::Shells (directions).select_shells (false, false, false); + Eigen::MatrixXd dirs; - E_bipolar[i] += E; - E_bipolar[j] += E; + for (size_t n = 0; n < shells.count(); ++n) { + dirs.resize (shells[n].count(), 3); + for (size_t idx = 0; idx < shells[n].count(); ++idx) + dirs.row (idx) = directions.row (shells[n].get_volumes()[idx]).head (3); + report (std::string (argument[0]) + " (b=" + str(shells[n].get_mean()) + ")", dirs); } + } + else + report (argument[0], directions); +} - auto report_NN = [](const vector& NN) { - double min = std::numeric_limits::max(); - double mean = 0.0; - double max = 0.0; - for (auto a : NN) { - a = (180.0/Math::pi) * std::acos (a); - mean += a; - min = std::min (min, a); - max = std::max (max, a); - } - mean /= NN.size(); - print (" nearest-neighbour angles: mean = " + str(mean, precision) + ", range [ " + str(min, precision) + " - " + str(max, precision) + " ]\n"); - }; - auto report_E = [](const vector& E) { - double min = std::numeric_limits::max(); - double total = 0.0; - double max = 0.0; - for (auto e : E) { - total += e; - min = std::min (min, e); - max = std::max (max, e); + + + + + +void report (const std::string& title, Eigen::MatrixXd& directions) +{ + if (directions.cols() < 3) + throw Exception ("unexpected matrix size for DW scheme \"" + str(argument[0]) + "\""); + DWI::normalise_grad (directions); + + if (log_level) + print (title + " [ " + str(directions.rows(), precision) + " directions ]\n"); + + + if ((bipolar | unipolar) && (energy | nearest_neighour)) { + vector NN_bipolar (directions.rows(), -1.0); + vector NN_unipolar (directions.rows(), -1.0); + + vector E_bipolar (directions.rows(), 0.0); + vector E_unipolar (directions.rows(), 0.0); + + for (ssize_t i = 0; i < directions.rows()-1; ++i) { + for (ssize_t j = i+1; j < directions.rows(); ++j) { + double cos_angle = directions.row(i).head(3).normalized().dot (directions.row(j).head(3).normalized()); + NN_unipolar[i] = std::max (NN_unipolar[i], cos_angle); + NN_unipolar[j] = std::max (NN_unipolar[j], cos_angle); + cos_angle = std::abs (cos_angle); + NN_bipolar[i] = std::max (NN_bipolar[i], cos_angle); + NN_bipolar[j] = std::max (NN_bipolar[j], cos_angle); + + double E = 1.0 / (directions.row(i).head(3) - directions.row(j).head(3)).norm(); + + E_unipolar[i] += E; + E_unipolar[j] += E; + + E += 1.0 / (directions.row(i).head(3) + directions.row(j).head(3)).norm(); + + E_bipolar[i] += E; + E_bipolar[j] += E; + + } } - print (" energy: total = " + str(0.5*total, precision) + ", mean = " + str(total/E.size(), precision) + ", range [ " + str(min, precision) + " - " + str(max, precision) + " ]\n"); - }; - print (title + " [ " + str(directions.rows(), precision) + " directions ]\n\n"); + auto report_NN = [](const vector& NN) { + double NN_min = std::numeric_limits::max(); + double NN_mean = 0.0; + double NN_max = 0.0; + for (auto a : NN) { + a = (180.0/Math::pi) * std::acos (a); + NN_mean += a; + NN_min = std::min (NN_min, a); + NN_max = std::max (NN_max, a); + } + NN_mean /= NN.size(); - print (" Bipolar electrostatic repulsion model:\n"); - report_NN (NN_bipolar); - report_E (E_bipolar); + std::string output; - print ("\n Unipolar electrostatic repulsion model:\n"); - report_NN (NN_unipolar); - report_E (E_unipolar); + if (log_level) + output = " nearest-neighbour angles: "; - std::string lmax_results; - for (size_t lmax = 2; lmax <= Math::SH::LforN (directions.rows()); lmax += 2) - lmax_results += " " + str(DWI::condition_number_for_lmax (directions, lmax), precision); - print ("\n Spherical Harmonic fit:\n condition numbers for lmax = " + str(2) + " -> " - + str(Math::SH::LforN (directions.rows()), precision) + ":" + lmax_results + "\n\n"); -} + if (mean) { + if (log_level) + output += "mean = "; + output += str(NN_mean, precision); + } + if (range) { + if (mean) + output += log_level ? ", " : " "; + if (log_level) + output += "range [ " + str(NN_min, precision) + " - " + str(NN_max, precision) + " ]"; + else + output += str(NN_min, precision) + " " + str(NN_max, precision); + } + if (output.size()) + print (output + "\n"); + }; -void run () -{ - try { - auto directions = DWI::Directions::load_cartesian (argument[0]); - report (argument[0], directions); - } - catch (Exception& E) { - auto directions = load_matrix (argument[0]); - DWI::normalise_grad (directions); - if (directions.cols() < 3) - throw Exception ("unexpected matrix size for DW scheme \"" + str(argument[0]) + "\""); - print (str(argument[0]) + " [ " + str(directions.rows()) + " volumes ]\n"); - DWI::Shells shells (directions); - for (size_t n = 0; n < shells.count(); ++n) { - Eigen::MatrixXd subset (shells[n].count(), 3); - for (ssize_t i = 0; i < subset.rows(); ++i) - subset.row(i) = directions.row(shells[n].get_volumes()[i]).head(3); - report ("\nb = " + str(shells[n].get_mean(), precision), subset); + auto report_E = [](const vector& E) { + double E_min = std::numeric_limits::max(); + double E_total = 0.0; + double E_max = 0.0; + for (auto e : E) { + E_total += e; + E_min = std::min (E_min, e); + E_max = std::max (E_max, e); + } + + + std::string output; + + if (log_level) + output = " energy: "; + + if (total) { + if (log_level) + output += "total = "; + output += str(0.5*E_total, precision); + } + + if (mean) { + if (total) + output += log_level ? ", " : " "; + if (log_level) + output += "mean = "; + output += str(E_total/E.size(), precision); + } + + if (range) { + if (mean | total) + output += log_level ? ", " : " "; + if (log_level) + output += "range [ " + str(E_min, precision) + " - " + str(E_max, precision) + " ]"; + else + output += str(E_min, precision) + " " + str(E_max, precision); + } + + if (output.size()) + print (output + "\n"); + }; + + + + + + + if (bipolar) { + if (log_level) + print ("\n Bipolar electrostatic repulsion model:\n"); + if (nearest_neighour) + report_NN (NN_bipolar); + if (energy) + report_E (E_bipolar); + } + + if (unipolar) { + if (log_level) + print ("\n Unipolar electrostatic repulsion model:\n"); + if (nearest_neighour) + report_NN (NN_unipolar); + if (energy) + report_E (E_unipolar); } + } + + + if (shfit) { + std::string lmax_results; + for (size_t lmax = 2; lmax <= Math::SH::LforN (directions.rows()); lmax += 2) + lmax_results += str(DWI::condition_number_for_lmax (directions, lmax), precision) + " "; + if (log_level) + print ("\n Spherical Harmonic fit:\n condition numbers for lmax = " + str(2) + " -> " + + str(Math::SH::LforN (directions.rows()), precision) + ": "); + print (lmax_results + "\n"); + } + + if (symmetry) { + if (log_level) + print ("\n Symmetry of sampling:\n norm of mean direction vector = "); + auto symmetry_index = directions.leftCols(3).colwise().mean().norm(); + print (str (symmetry_index, precision) + "\n"); + if (log_level && symmetry_index >= 0.1) + print (std::string (" WARNING: sampling is ") + ( symmetry_index >= 0.4 ? "strongly" : "moderately" ) + + " asymmetric - this may affect resiliance to eddy-current distortions"); + } + + if (log_level) + print ("\n"); } + From 6e1221b60f8406a6a3bed41e61cafa6690ce2e62 Mon Sep 17 00:00:00 2001 From: Lestropie Date: Thu, 5 Oct 2017 13:55:23 +1100 Subject: [PATCH 176/538] dwipreproc: More changes for -align_seepi option - Immediately exit if -align_seepi is provided but -se_epi is not. - In the situation where no -se_epi input is provided, it is still necessary to ensure that the first DWI volume provided to eddy is the first b=0 volume that was provided to topup. - Some tweaking of temporary image names to more accurately reflect flow of script, and some better running cleanup of temporary files. --- bin/dwipreproc | 235 +++++++++++++++++++++++++-------------------- lib/mrtrix3/app.py | 6 +- 2 files changed, 132 insertions(+), 109 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index a4dce489b0..46510b2b3f 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -83,6 +83,9 @@ elif app.args.rpe_header: else: app.error('Must explicitly specify phase-encoding acquisition design (even if none)') +if app.args.align_seepi and not app.args.se_epi: + app.error('-align_seepi option is only applicable when the -se_epi option is also used') + fsl_path = os.environ.get('FSLDIR', '') if not fsl_path: app.error('Environment variable FSLDIR is not set; please run appropriate FSL configuration script') @@ -327,6 +330,22 @@ if dwi_manual_pe_scheme: +# Find the index of the first DWI volume that is a b=0 volume +# This needs to occur at the outermost loop as it is pertinent information +# not only for the -align_seepi option, but also for when the -se_epi option +# is not provided at all, and the input top topup is extracted solely from the DWIs +bzero_threshold = 10.0 +if 'BZeroThreshold' in app.config: + bzero_threshold = float(app.config['BZeroThreshold']) +dwi_first_bzero_index = 0 +for line in grad: + if line[3] <= bzero_threshold: + break + dwi_first_bzero_index += 1 +app.var(dwi_first_bzero_index) + + + # Deal with the phase-encoding of the images to be fed to topup (if applicable) overwrite_se_epi_pe_scheme = False se_epi_path = 'se_epi.mif' @@ -391,7 +410,7 @@ if app.args.se_epi: # * If _not_ present in own header: # Cannot proceed if not se_epi_pe_scheme: - app.error('No phase-encoding information present in SE EPI image header') + app.error('No phase-encoding information present in SE-EPI image header') # If there is no phase encoding contrast within the SE-EPI series, # try combining it with the DWI b=0 volumes, see if that produces some contrast # However, this should probably only be permitted if the -align_seepi option is defined @@ -449,89 +468,59 @@ if app.args.se_epi: # (due to the absence of phase-encoding contrast in the SE-EPI series), we don't want to # re-attempt such a concatenation; the fact that the DWI b=0 images were inserted ahead of # the SE-EPI images means the alignment issue should be dealt with. - # Note however that in this instance it may still be necessary to permute the volumes within the - # DWI series if the first volume is not a b=0 volume; but the first b=0 volume will inherently - # already be the first volume in the input to topup - - bzero_threshold = 10.0 - if 'BZeroThreshold' in app.config: - bzero_threshold = float(app.config['BZeroThreshold']) - dwi_first_bzero_index = 0 - for line in grad: - if line[3] <= bzero_threshold: - break - dwi_first_bzero_index += 1 + if dwi_first_bzero_index == len(grad) and not dwi_bzero_added_to_se_epi: + app.warn('Unable to find b=0 volume in input DWIs to provide alignment between topup and eddy; script will proceed as though the -align_seepi option were not provided') - else: - # If the first b=0 volume in the DWIs is in fact not the volume (i.e. index zero), we're going to - # manually place it at the start of the DWI volumes when they are input to eddy, so that the - # first input volume to topup and the first input volume to eddy are one and the same. - # Note: If at a later date, the statistical outputs from eddy are considered (e.g. motion, outliers), - # then this volume permutation will need to be taken into account - if dwi_first_bzero_index: - app.console('First b=0 volume in input DWIs is volume index ' + str(dwi_first_bzero_index) + '; ' - 'this will be permuted to be the first volume (index 0) when eddy is run') - dwi_permute_volumes_pre_eddy_option = ' -coord 3 ' + \ - str(dwi_first_bzero_index) + \ - ',0' + \ - (':' + str(dwi_first_bzero_index-1) if dwi_first_bzero_index > 1 else '') + \ - (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < dwi_num_volumes-1 else '') + \ - (':' + str(dwi_num_volumes-1) if dwi_first_bzero_index < dwi_num_volumes-2 else '') - dwi_permute_volumes_post_eddy_option = ' -coord 3 1' + \ - (':' + str(dwi_first_bzero_index) if dwi_first_bzero_index > 1 else '') + \ - ',0' + \ - (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < dwi_num_volumes-1 else '') + \ - (':' + str(dwi_num_volumes-1) if dwi_first_bzero_index < dwi_num_volumes-2 else '') - - # If b=0 volumes from the DWIs have already been added to the SE-EPI image due to an - # absence of phase-encoding contrast in the latter, we don't need to perform the following - if not dwi_bzero_added_to_se_epi: - - run.command('mrconvert dwi.mif dwi_first_bzero.mif -coord 3 ' + str(dwi_first_bzero_index) + ' -axes 0,1,2') - dwi_first_bzero_pe = dwi_manual_pe_scheme[dwi_first_bzero_index] if overwrite_dwi_pe_scheme else dwi_pe_scheme[dwi_first_bzero_index] - - se_epi_pe_sum = [ 0, 0, 0 ] - se_epi_volume_to_remove = len(se_epi_pe_scheme) - for index, line in enumerate(se_epi_pe_scheme): - se_epi_pe_sum = [ i + j for i, j in zip(se_epi_pe_sum, line[0:3]) ] - if se_epi_volume_to_remove == len(se_epi_pe_scheme) and line[0:3] == dwi_first_bzero_pe[0:3]: - se_epi_volume_to_remove = index - new_se_epi_path = os.path.splitext(se_epi_path)[0] + '_firstdwibzero.mif' - if (se_epi_pe_sum == [ 0, 0, 0 ]) and (se_epi_volume_to_remove < len(se_epi_pe_scheme)): - app.console('Balanced phase-encoding scheme detected in \'' + app.args.se_epi + '\'; volume ' + str(se_epi_volume_to_remove) + ' will be removed and replaced with first b=0 from DWIs') - run.command('mrconvert ' + se_epi_path + ' - -coord 3 ' + ','.join([str(index) for index in range(len(se_epi_pe_scheme)) if not index == se_epi_volume_to_remove]) + ' | mrcat dwi_first_bzero.mif - ' + new_se_epi_path + ' -axis 3') - # Also need to update the phase-encoding scheme appropriately if it's being set manually - # (if embedded within the image headers, should be updated through the command calls) - if se_epi_manual_pe_scheme: - first_line = list(manual_pe_dir) - first_line.append(trt) - new_se_epi_manual_pe_scheme = [ ] - new_se_epi_manual_pe_scheme.append(first_line) - for index, entry in enumerate(se_epi_manual_pe_scheme): - if not index == se_epi_volume_to_remove: - new_se_epi_manual_pe_scheme.append(entry) - se_epi_manual_pe_scheme = new_se_epi_manual_pe_scheme + # If b=0 volumes from the DWIs have already been added to the SE-EPI image due to an + # absence of phase-encoding contrast in the latter, we don't need to perform the following + elif not dwi_bzero_added_to_se_epi: + + run.command('mrconvert dwi.mif dwi_first_bzero.mif -coord 3 ' + str(dwi_first_bzero_index) + ' -axes 0,1,2') + dwi_first_bzero_pe = dwi_manual_pe_scheme[dwi_first_bzero_index] if overwrite_dwi_pe_scheme else dwi_pe_scheme[dwi_first_bzero_index] + + se_epi_pe_sum = [ 0, 0, 0 ] + se_epi_volume_to_remove = len(se_epi_pe_scheme) + for index, line in enumerate(se_epi_pe_scheme): + se_epi_pe_sum = [ i + j for i, j in zip(se_epi_pe_sum, line[0:3]) ] + if se_epi_volume_to_remove == len(se_epi_pe_scheme) and line[0:3] == dwi_first_bzero_pe[0:3]: + se_epi_volume_to_remove = index + new_se_epi_path = os.path.splitext(se_epi_path)[0] + '_firstdwibzero.mif' + if (se_epi_pe_sum == [ 0, 0, 0 ]) and (se_epi_volume_to_remove < len(se_epi_pe_scheme)): + app.console('Balanced phase-encoding scheme detected in SE-EPi series; volume ' + str(se_epi_volume_to_remove) + ' will be removed and replaced with first b=0 from DWIs') + run.command('mrconvert ' + se_epi_path + ' - -coord 3 ' + ','.join([str(index) for index in range(len(se_epi_pe_scheme)) if not index == se_epi_volume_to_remove]) + ' | mrcat dwi_first_bzero.mif - ' + new_se_epi_path + ' -axis 3') + # Also need to update the phase-encoding scheme appropriately if it's being set manually + # (if embedded within the image headers, should be updated through the command calls) + if se_epi_manual_pe_scheme: + first_line = list(manual_pe_dir) + first_line.append(trt) + new_se_epi_manual_pe_scheme = [ ] + new_se_epi_manual_pe_scheme.append(first_line) + for index, entry in enumerate(se_epi_manual_pe_scheme): + if not index == se_epi_volume_to_remove: + new_se_epi_manual_pe_scheme.append(entry) + se_epi_manual_pe_scheme = new_se_epi_manual_pe_scheme + else: + if se_epi_pe_sum == [ 0, 0, 0 ] and se_epi_volume_to_remove == len(se_epi_pe_scheme): + app.console('Phase-encoding scheme of -se_epi image is balanced, but could not find appropriate volume with which to substitute first b=0 volume from DWIs; first b=0 DWI volume will be inserted to start of series, resulting in an unbalanced scheme') else: - if se_epi_pe_sum == [ 0, 0, 0 ] and se_epi_volume_to_remove == len(se_epi_pe_scheme): - app.console('Phase-encoding scheme of -se_epi image is balanced, but could not find appropriate volume with which to substitute first b=0 volume from DWIs; first b=0 DWI volume will be inserted to start of series, resulting in an unbalanced scheme') - else: - app.console('Unbalanced phase-encoding scheme detected in series provided via -se_epi option; first DWI b=0 volume will be inserted to start of series') - run.command('mrcat dwi_first_bzero.mif ' + se_epi_path + ' ' + new_se_epi_path + ' -axis 3') - # Also need to update the phase-encoding scheme appropriately - if se_epi_manual_pe_scheme: - first_line = list(manual_pe_dir) - first_line.append(trt) - se_epi_manual_pe_scheme = [ first_line, se_epi_manual_pe_scheme ] - - # Ended branching based on balanced-ness of PE acquisition scheme within SE-EPI volumes - file.delTemporary(se_epi_path) - se_epi_path = new_se_epi_path - - # Ended branching based on prior merge of SE-EPI and DWI b=0 volumes due to no phase-encoding contrast in SE-EPI - - # Completed checking for presence of b=0 image in DWIs + app.console('Unbalanced phase-encoding scheme detected in series provided via -se_epi option; first DWI b=0 volume will be inserted to start of series') + run.command('mrcat dwi_first_bzero.mif ' + se_epi_path + ' ' + new_se_epi_path + ' -axis 3') + # Also need to update the phase-encoding scheme appropriately + if se_epi_manual_pe_scheme: + first_line = list(manual_pe_dir) + first_line.append(trt) + se_epi_manual_pe_scheme = [ first_line, se_epi_manual_pe_scheme ] + + # Ended branching based on balanced-ness of PE acquisition scheme within SE-EPI volumes + file.delTemporary(se_epi_path) + file.delTemporary('dwi_first_bzero.mif') + se_epi_path = new_se_epi_path + + # Ended branching based on: + # - Detection of first b=0 volume in DWIs; or + # - Prior merge of SE-EPI and DWI b=0 volumes due to no phase-encoding contrast in SE-EPI # Completed checking for presence of -se_epi option @@ -559,6 +548,30 @@ elif not PE_design == 'None': # No SE EPI images explicitly provided: In some ca se_epi_header = None + +# If the first b=0 volume in the DWIs is in fact not the first volume (i.e. index zero), we're going to +# manually place it at the start of the DWI volumes when they are input to eddy, so that the +# first input volume to topup and the first input volume to eddy are one and the same. +# Note: If at a later date, the statistical outputs from eddy are considered (e.g. motion, outliers), +# then this volume permutation will need to be taken into account +if dwi_first_bzero_index: + app.console('First b=0 volume in input DWIs is volume index ' + str(dwi_first_bzero_index) + '; ' + 'this will be permuted to be the first volume (index 0) when eddy is run') + dwi_permute_volumes_pre_eddy_option = ' -coord 3 ' + \ + str(dwi_first_bzero_index) + \ + ',0' + \ + (':' + str(dwi_first_bzero_index-1) if dwi_first_bzero_index > 1 else '') + \ + (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < dwi_num_volumes-1 else '') + \ + (':' + str(dwi_num_volumes-1) if dwi_first_bzero_index < dwi_num_volumes-2 else '') + dwi_permute_volumes_post_eddy_option = ' -coord 3 1' + \ + (':' + str(dwi_first_bzero_index) if dwi_first_bzero_index > 1 else '') + \ + ',0' + \ + (',' + str(dwi_first_bzero_index+1) if dwi_first_bzero_index < dwi_num_volumes-1 else '') + \ + (':' + str(dwi_num_volumes-1) if dwi_first_bzero_index < dwi_num_volumes-2 else '') + app.var(dwi_permute_volumes_pre_eddy_option, dwi_permute_volumes_post_eddy_option) + + + # This may be required when setting up the topup call import_se_epi_manual_pe_table_option = '' if se_epi_manual_pe_scheme: @@ -592,7 +605,7 @@ if do_topup: if int(axis_size%2): odd_axis_count += 1 if odd_axis_count: - app.console(str(odd_axis_count) + ' spatial ' + ('axes' if odd_axis_count > 1 else 'axis') + ' of DWIs have non-even size; ' + app.console(str(odd_axis_count) + ' spatial ' + ('axes of DWIs have' if odd_axis_count > 1 else 'axis of DWIs has') + ' non-even size; ' 'this will be automatically padded for compatibility with topup, and the extra slice' + ('s' if odd_axis_count > 1 else '') + ' erased afterwards') for axis, axis_size in enumerate(dwi_header.size()[:3]): if int(axis_size%2): @@ -601,7 +614,7 @@ if do_topup: file.delTemporary(se_epi_path) se_epi_path = new_se_epi_path new_dwi_path = os.path.splitext(dwi_path)[0] + '_pad' + str(axis) + '.mif' - run.command('mrconvert ' + dwi_path + ' -coord ' + str(axis) + ' ' + str(axis_size-1) + ' - | mrcat ' + dwi_path + ' - ' + new_dwi_path + ' - axis ' + str(axis)) + run.command('mrconvert ' + dwi_path + ' -coord ' + str(axis) + ' ' + str(axis_size-1) + ' - | mrcat ' + dwi_path + ' - ' + new_dwi_path + ' -axis ' + str(axis)) file.delTemporary(dwi_path) dwi_path = new_dwi_path dwi_post_eddy_crop_option += ' -coord ' + str(axis) + ' 0:' + str(axis_size-1) @@ -632,10 +645,11 @@ if do_topup: index = 1 with open('applytopup_config.txt', 'r') as f: for line in f: - input_path = 'dwi_pe_' + str(index) + '.nii' - json_path = 'dwi_pe_' + str(index) + '.json' - temp_path = 'dwi_pe_' + str(index) + '_applytopup' + fsl_suffix - output_path = 'dwi_pe_' + str(index) + '_applytopup.mif' + prefix = os.path.splitext(dwi_path)[0] + '_pe_' + str(index) + input_path = prefix + '.nii' + json_path = prefix + '.json' + temp_path = prefix + '_applytopup.nii' + output_path = prefix + '_applytopup.mif' run.command('dwiextract ' + dwi_path + import_dwi_pe_table_option + ' -pe ' + ','.join(line.split()) + ' - | mrconvert - ' + input_path + ' -json_export ' + json_path) run.command(applytopup_cmd + ' --imain=' + input_path + ' --datain=applytopup_config.txt --inindex=' + str(index) + ' --topup=field --out=' + temp_path + ' --method=jac') file.delTemporary(input_path) @@ -648,9 +662,9 @@ if do_topup: # Use the initial corrected volumes to derive a brain mask for eddy if len(applytopup_image_list) == 1: - run.command('dwi2mask ' + applytopup_image_list[0] + ' - | maskfilter - dilate - | mrconvert - mask.nii -datatype float32 -stride -1,+2,+3') + run.command('dwi2mask ' + applytopup_image_list[0] + ' - | maskfilter - dilate - | mrconvert - eddy_mask.nii -datatype float32 -stride -1,+2,+3') else: - run.command('mrcat ' + ' '.join(applytopup_image_list) + ' - -axis 3 | dwi2mask - - | maskfilter - dilate - | mrconvert - mask.nii -datatype float32 -stride -1,+2,+3') + run.command('mrcat ' + ' '.join(applytopup_image_list) + ' - -axis 3 | dwi2mask - - | maskfilter - dilate - | mrconvert - eddy_mask.nii -datatype float32 -stride -1,+2,+3') for entry in applytopup_image_list: file.delTemporary(entry) @@ -660,17 +674,22 @@ if do_topup: else: # Generate a processing mask for eddy based on the uncorrected input DWIs - run.command('dwi2mask ' + dwi_path + ' - | maskfilter - dilate - | mrconvert - mask.nii -datatype float32 -stride -1,+2,+3') + run.command('dwi2mask ' + dwi_path + ' - | maskfilter - dilate - | mrconvert - eddy_mask.nii -datatype float32 -stride -1,+2,+3') # Run eddy -run.command('mrconvert ' + dwi_path + import_dwi_pe_table_option + dwi_permute_volumes_pre_eddy_option + ' dwi.nii -stride -1,+2,+3,+4 -export_grad_fsl bvecs bvals -export_pe_eddy eddy_config.txt eddy_indices.txt') +run.command('mrconvert ' + dwi_path + import_dwi_pe_table_option + dwi_permute_volumes_pre_eddy_option + ' eddy_in.nii -stride -1,+2,+3,+4 -export_grad_fsl bvecs bvals -export_pe_eddy eddy_config.txt eddy_indices.txt') file.delTemporary(dwi_path) eddy_manual_options = '' if app.args.eddy_options: eddy_manual_options = ' ' + app.args.eddy_options.strip() -run.command(eddy_cmd + ' --imain=dwi.nii --mask=mask.nii --acqp=eddy_config.txt --index=eddy_indices.txt --bvecs=bvecs --bvals=bvals' + eddy_in_topup_option + eddy_manual_options + ' --out=dwi_post_eddy') +run.command(eddy_cmd + ' --imain=eddy_in.nii --mask=eddy_mask.nii --acqp=eddy_config.txt --index=eddy_indices.txt --bvecs=bvecs --bvals=bvals' + eddy_in_topup_option + eddy_manual_options + ' --out=dwi_post_eddy') +file.delTemporary('eddy_in.nii') +file.delTemporary('eddy_mask.nii') +if do_topup: + file.delTemporary(fsl.findImage('field_fieldcoef')) +eddy_output_image_path = fsl.findImage('dwi_post_eddy') @@ -712,8 +731,13 @@ for index1 in range(dwi_num_volumes): if not len(volume_pairs) == int(dwi_num_volumes/2): + if do_topup: + file.delTemporary('topup_in.nii') + file.delTemporary(fsl.findImage('field_map')) + # Convert the resulting volume to the output image, and re-insert the diffusion encoding - run.command('mrconvert ' + fsl.findImage('dwi_post_eddy') + ' result.mif' + dwi_permute_volumes_post_eddy_option + dwi_post_eddy_crop_option + stride_option + ' -fslgrad ' + bvecs_path + ' bvals') + run.command('mrconvert ' + eddy_output_image_path + ' result.mif' + dwi_permute_volumes_post_eddy_option + dwi_post_eddy_crop_option + stride_option + ' -fslgrad ' + bvecs_path + ' bvals') + file.delTemporary(eddy_output_image_path) else: app.console('Detected matching DWI volumes with opposing phase encoding; performing explicit volume recombination') @@ -811,25 +835,25 @@ else: file.delTemporary(field_derivative_path) run.command('mrcalc ' + jacobian_path + ' ' + jacobian_path + ' -mult weight' + str(index+1) + '.mif') file.delTemporary(jacobian_path) + file.delTemporary(field_map_image) # If eddy provides its main image output in a compressed format, the code block below will need to # uncompress that image independently for every volume pair. Instead, if this is the case, let's # convert it to an uncompressed format before we do anything with it. - eddy_output = fsl.findImage('dwi_post_eddy') - if eddy_output.endswith('.gz'): - new_eddy_output = 'dwi_post_eddy_uncompressed.mif' - run.command('mrconvert ' + eddy_output + ' ' + new_eddy_output) - file.delTemporary(eddy_output) - eddy_output = new_eddy_output + if eddy_output_image_path.endswith('.gz'): + new_eddy_output_image_path = 'dwi_post_eddy_uncompressed.mif' + run.command('mrconvert ' + eddy_output_image_path + ' ' + new_eddy_output_image_path) + file.delTemporary(eddy_output_image_path) + eddy_output_image_path = new_eddy_output_image_path # If the DWI volumes were permuted prior to running eddy, then the simplest approach is to permute them # back to their original positions; otherwise, the stored gradient vector directions / phase encode # directions / matched volume pairs are no longer appropriate if dwi_permute_volumes_post_eddy_option: - new_eddy_output = os.path.splitext(eddy_output)[0] + '_volpermuteundo.mif' - run.command('mrconvert ' + eddy_output + dwi_permute_volumes_post_eddy_option + ' ' + new_eddy_output) - file.delTemporary(eddy_output) - eddy_output = new_eddy_output + new_eddy_output_image_path = os.path.splitext(eddy_output_image_path)[0] + '_volpermuteundo.mif' + run.command('mrconvert ' + eddy_output_image_path + dwi_permute_volumes_post_eddy_option + ' ' + new_eddy_output_image_path) + file.delTemporary(eddy_output_image_path) + eddy_output_image_path = new_eddy_output_image_path # This section extracts the two volumes corresponding to each reversed phase-encoded volume pair, and # derives a single image volume based on the recombination equation @@ -837,8 +861,8 @@ else: progress = app.progressBar('Performing explicit volume recombination', len(volume_pairs)) for index, volumes in enumerate(volume_pairs): pe_indices = [ eddy_indices[i] for i in volumes ] - run.command('mrconvert ' + eddy_output + ' volume0.mif -coord 3 ' + str(volumes[0])) - run.command('mrconvert ' + eddy_output + ' volume1.mif -coord 3 ' + str(volumes[1])) + run.command('mrconvert ' + eddy_output_image_path + ' volume0.mif -coord 3 ' + str(volumes[0])) + run.command('mrconvert ' + eddy_output_image_path + ' volume1.mif -coord 3 ' + str(volumes[1])) # Volume recombination equation described in Skare and Bammer 2010 combined_image_path = 'combined' + str(index) + '.mif' run.command('mrcalc volume0.mif weight' + str(pe_indices[0]) + '.mif -mult volume1.mif weight' + str(pe_indices[1]) + '.mif -mult -add weight' + str(pe_indices[0]) + '.mif weight' + str(pe_indices[1]) + '.mif -add -divide 0.0 -max ' + combined_image_path) @@ -848,7 +872,7 @@ else: progress.increment() progress.done() - file.delTemporary(eddy_output) + file.delTemporary(eddy_output_image_path) for index in range(0, len(eddy_config)): file.delTemporary('weight' + str(index+1) + '.mif') @@ -860,7 +884,6 @@ else: # Should header key-values only in place for the purposes of pre-processing (i.e. TE, TR, flip angle, in-plane acceleration) be erased? - # Finish! run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + grad_export_option + (' -force' if app.forceOverwrite else '')) app.complete() diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index dad9a9252e..d60bcd1459 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -813,7 +813,7 @@ def _update(self): global clearLine, colourConsole, colourClear, colourExec assert not self.iscomplete if self.isatty: - sys.stderr.write('\r' + self.scriptname + ': ' + colourExec + '[' + ('{0:>3}%'.format(self.value) if self.multiplier else progressBar._busy[self.counter%6]) + '] ' + colourConsole + self.message + '... ' + colourClear + clearLine + self.newline) + sys.stderr.write('\r' + self.scriptname + ': ' + colourExec + '[' + ('{0:>3}%'.format(self.value) if self.multiplier else progressBar._busy[self.counter%6]) + ']' + colourClear + ' ' + colourConsole + self.message + '... ' + colourClear + clearLine + self.newline) else: if self.newline: sys.stderr.write(self.scriptname + ': ' + self.message + '... [' + ('=' * int(self.value/2)) + self.newline) @@ -836,7 +836,7 @@ def __init__(self, msg, target=0): self.value = 0 verbosity = verbosity - 1 if verbosity else 0 if self.isatty: - sys.stderr.write(self.scriptname + ': ' + colourExec + '[' + ('{0:>3}%'.format(self.value) if self.multiplier else progressBar._busy[0]) + '] ' + colourConsole + self.message + '... ' + colourClear + clearLine + self.newline) + sys.stderr.write(self.scriptname + ': ' + colourExec + '[' + ('{0:>3}%'.format(self.value) if self.multiplier else progressBar._busy[0]) + ']' + colourClear + ' ' + colourConsole + self.message + '... ' + colourClear + clearLine + self.newline) else: sys.stderr.write(self.scriptname + ': ' + self.message + '... [' + self.newline) sys.stderr.flush() @@ -867,7 +867,7 @@ def done(self): self.iscomplete = True self.value = 100 if self.isatty: - sys.stderr.write('\r' + self.scriptname + ': ' + colourExec + '[' + ('100%' if self.multiplier else 'done') + '] ' + colourConsole + self.message + colourClear + clearLine + '\n') + sys.stderr.write('\r' + self.scriptname + ': ' + colourExec + '[' + ('100%' if self.multiplier else 'done') + ']' + colourClear + ' ' + colourConsole + self.message + colourClear + clearLine + '\n') else: if self.newline: sys.stderr.write(self.scriptname + ': ' + self.message + ' [' + ('=' * (self.value/2)) + ']\n') From 0b9567b139841ba479c1662d760ebf7057e257c3 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 5 Oct 2017 15:05:36 +1100 Subject: [PATCH 177/538] dwipreproc -align_seepi: Cleanup & pylint compliance --- bin/dwipreproc | 4 ++-- cmd/warpconvert.cpp | 14 +++++++------- docs/reference/scripts/dwipreproc.rst | 2 ++ lib/mrtrix3/image.py | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 46510b2b3f..9574246600 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -419,7 +419,7 @@ if app.args.se_epi: if app.args.align_seepi: app.console('No phase-encoding contrast present in SE-EPI images; will examine again after combining with DWI b=0 images') new_se_epi_path = os.path.splitext(se_epi_path)[0] + '_dwibzeros.mif' - # TODO Should a balanced scheme be produced if possible? + # Don't worry about trying to produce a balanced scheme here run.command('dwiextract dwi.mif - -bzero | mrcat - se_epi.mif ' + new_se_epi_path + ' -axis 3') se_epi_header = image.Header(new_se_epi_path) se_epi_pe_scheme_has_contrast = 'pe_scheme' in se_epi_header.keyval() @@ -458,7 +458,7 @@ if app.args.se_epi: app.warn('It appears that the spin-echo EPI images used for inhomogeneity field estimation have a different flip angle to the DWIs being corrected. ' 'This may cause issues in estimation of the field, as the first DWI b=0 volume will be added to the input series to topup ' 'due to use of the -align_seepi option.') - + # If we are using the -se_epi option, and hence the input images to topup have not come from the DWIs themselves, # we need to insert the first b=0 DWI volume to the start of the topup input image. Otherwise, the field estimated # by topup will not be correctly aligned with the volumes as they are processed by eddy. diff --git a/cmd/warpconvert.cpp b/cmd/warpconvert.cpp index beaddfbe18..84530f7426 100644 --- a/cmd/warpconvert.cpp +++ b/cmd/warpconvert.cpp @@ -23,7 +23,7 @@ using namespace MR; using namespace App; -const char* conversion_type[] = {"deformation2displacement","displacement2deformation","warpfull2deformation","warpfull2displacement",nullptr}; +const char* conversion_types[] = {"deformation2displacement","displacement2deformation","warpfull2deformation","warpfull2displacement",nullptr}; void usage () @@ -40,7 +40,7 @@ void usage () ARGUMENTS + Argument ("in", "the input warp image.").type_image_in () - + Argument ("type", "the conversion type required. Valid choices are: " + join(conversion_type, ", ")).type_choice (conversion_type) + + Argument ("type", "the conversion type required. Valid choices are: " + join(conversion_types, ", ")).type_choice (conversion_types) + Argument ("out", "the output warp image.").type_image_out (); OPTIONS @@ -62,7 +62,7 @@ void usage () void run () { - const int conversion_type = argument[1]; + const int type = argument[1]; bool midway_space = get_options("midway_space").size() ? true : false; std::string template_filename; @@ -76,7 +76,7 @@ void run () from = opt[0][0]; // deformation2displacement - if (conversion_type == 0) { + if (type == 0) { if (midway_space) WARN ("-midway_space option ignored with deformation2displacement conversion type"); if (get_options ("template").size()) @@ -93,7 +93,7 @@ void run () Registration::Warp::deformation2displacement (deformation, displacement); // displacement2deformation - } else if (conversion_type == 1) { + } else if (type == 1) { auto displacement = Image::open (argument[0]).with_direct_io (3); Registration::Warp::check_warp (displacement); @@ -110,7 +110,7 @@ void run () Registration::Warp::displacement2deformation (displacement, deformation); // warpfull2deformation & warpfull2displacement - } else if (conversion_type == 2 || conversion_type == 3) { + } else if (type == 2 || type == 3) { auto warp = Image::open (argument[0]).with_direct_io (3); Registration::Warp::check_warp_full (warp); @@ -125,7 +125,7 @@ void run () warp_output = Registration::Warp::compute_full_deformation (warp, template_header, from); } - if (conversion_type == 3) + if (type == 3) Registration::Warp::deformation2displacement (warp_output, warp_output); Header header (warp_output); diff --git a/docs/reference/scripts/dwipreproc.rst b/docs/reference/scripts/dwipreproc.rst index c0f1392fbc..485df8c468 100644 --- a/docs/reference/scripts/dwipreproc.rst +++ b/docs/reference/scripts/dwipreproc.rst @@ -46,6 +46,8 @@ Other options for the dwipreproc script - **-se_epi file** Provide an additional image series consisting of spin-echo EPI images, which is to be used exclusively by topup for estimating the inhomogeneity field (i.e. it will not form part of the output image series) +- **-align_seepi** Achieve alignment between the SE-EPI images used for inhomogeneity field estimation, and the DWIs, by inserting the first DWI b=0 volume to the SE-EPI series. Only use this option if the input SE-EPI images have identical image contrast to the b=0 images present in the DWI series. + - **-json_import JSON_file** Import image header information from an associated JSON file (may be necessary to determine phase encoding information) - **-topup_options TopupOptions** Manually provide additional command-line options to the topup command (provide a string within quotation marks that contains at least one space, even if only passing a single command-line option to topup) diff --git a/lib/mrtrix3/image.py b/lib/mrtrix3/image.py index 8365250464..07499ae965 100644 --- a/lib/mrtrix3/image.py +++ b/lib/mrtrix3/image.py @@ -105,7 +105,7 @@ def mrinfo(image_path, field): #pylint: disable=unused-variable # Check to see whether the fundamental header properties of two images match # Inputs can be either _Header class instances, or file paths -def match(image_one, image_two, max_dim=0): #pylint: disable=unused-variable +def match(image_one, image_two, max_dim=0): #pylint: disable=unused-variable, too-many-return-statements import math from mrtrix3 import app if not isinstance(image_one, Header): From d315aa098f4aabf151be84fcfa6bd236ca038412 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 5 Oct 2017 15:47:32 +1100 Subject: [PATCH 178/538] DICOM Import: Remove fields not related to dwipreproc -align_seepi work --- core/file/dicom/image.cpp | 16 ---------------- core/file/dicom/image.h | 10 ++++------ core/file/dicom/mapper.cpp | 10 ---------- 3 files changed, 4 insertions(+), 32 deletions(-) diff --git a/core/file/dicom/image.cpp b/core/file/dicom/image.cpp index b2551ed6f9..b2cf3f3a54 100644 --- a/core/file/dicom/image.cpp +++ b/core/file/dicom/image.cpp @@ -96,19 +96,6 @@ namespace MR { case 0x1314U: flip_angle = item.get_float()[0]; return; - case 0x9036U: - if (item.get_string()[0] == "PHASE") - partial_fourier_axis = 0; - else if (item.get_string()[0] == "FREQUENCY") - partial_fourier_axis = 1; - else if (item.get_string()[0] == "SLICE_SELECT") - partial_fourier_axis = 2; - else if (item.get_string()[0] == "COMBINATION") - partial_fourier_axis = -2; - return; - case 0x9069U: - parallel_inplane_factor = item.get_int()[0]; - return; case 0x9087U: bvalue = item.get_float()[0]; return; @@ -117,9 +104,6 @@ namespace MR { G[1] = item.get_float()[1]; G[2] = item.get_float()[2]; return; - case 0x9081U: - partial_fourier_fraction = item.get_float()[0]; - return; } return; case 0x0020U: diff --git a/core/file/dicom/image.h b/core/file/dicom/image.h index 82cfab3f43..abe50fc344 100644 --- a/core/file/dicom/image.h +++ b/core/file/dicom/image.h @@ -45,9 +45,8 @@ namespace MR { transfer_syntax_supported = true; pe_axis = 3; pe_sign = 0; - pixel_bandwidth = bandwidth_per_pixel_phase_encode = echo_time = repetition_time = flip_angle = partial_fourier_fraction = NaN; - echo_train_length = parallel_inplane_factor = 0; - partial_fourier_axis = -1; + pixel_bandwidth = bandwidth_per_pixel_phase_encode = echo_time = repetition_time = flip_angle = NaN; + echo_train_length = 0; } size_t acq_dim[2], dim[2], series_num, instance, acq, sequence; @@ -58,9 +57,8 @@ namespace MR { bool DW_scheme_wrt_image, transfer_syntax_supported; size_t pe_axis; int pe_sign; - default_type pixel_bandwidth, bandwidth_per_pixel_phase_encode, echo_time, repetition_time, flip_angle, partial_fourier_fraction; - size_t echo_train_length, parallel_inplane_factor; - int partial_fourier_axis; + default_type pixel_bandwidth, bandwidth_per_pixel_phase_encode, echo_time, repetition_time, flip_angle; + size_t echo_train_length; vector index; bool operator< (const Frame& frame) const { diff --git a/core/file/dicom/mapper.cpp b/core/file/dicom/mapper.cpp index 27400369f7..bef1b7b8c6 100644 --- a/core/file/dicom/mapper.cpp +++ b/core/file/dicom/mapper.cpp @@ -119,16 +119,6 @@ namespace MR { H.keyval()["EchoTime"] = str (0.001 * image.echo_time, 6); if (std::isfinite (image.flip_angle)) H.keyval()["FlipAngle"] = str (image.flip_angle, 6); - if (image.parallel_inplane_factor) - H.keyval()["ParallelReductionFactorInPlane"] = str (image.parallel_inplane_factor); - if (std::isfinite (image.partial_fourier_fraction)) - H.keyval()["PartialFourier"] = str (image.partial_fourier_fraction, 6); - // TODO This will need handling with regards to axis permutation - switch (image.partial_fourier_axis) { - case 0: H.keyval()["PartialFourierDirection"] = "i"; break; - case 1: H.keyval()["PartialFourierDirection"] = "j"; break; - case 2: H.keyval()["PartialFourierDirection"] = "k"; break; - } if (std::isfinite (image.repetition_time)) H.keyval()["RepetitionTime"] = str (0.001 * image.repetition_time, 6); From b8acdd4255f487b79d8659326024baeeccd69539 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Thu, 5 Oct 2017 16:26:55 +1100 Subject: [PATCH 179/538] docs update --- docs/reference/commands/dirstat.rst | 37 ++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/docs/reference/commands/dirstat.rst b/docs/reference/commands/dirstat.rst index 688baf4429..fd0af76794 100644 --- a/docs/reference/commands/dirstat.rst +++ b/docs/reference/commands/dirstat.rst @@ -15,11 +15,46 @@ Usage dirstat [ options ] dirs -- *dirs*: the text file containing the directions. +- *dirs*: the text file or image containing the directions. Options ------- +Output options +^^^^^^^^^^^^^^ + +- **-bipolar** output statistics for bipolar electrostatic repulsion model + +- **-unipolar** output statistics for unipolar electrostatic repulsion model + +- **-shfit** output statistics for spherical harmonics fit + +- **-symmetry** output measure of symmetry of spherical coverage (as given by the norm of mean direction vector). This is important to ensure minimal bias due to eddy-currents. + +- **-nearest_neighour** output nearest-neighbour angle statistics + +- **-energy** output energy statistics + +- **-total** output total of statistic (affects -energy only) + +- **-mean** output mean of statistic (affects -nearest_neighbour or -energy only) + +- **-range** output range of statistic (affects -nearest_neighbour or -energy only) + +DW gradient table import options +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- **-grad file** Provide the diffusion-weighted gradient scheme used in the acquisition in a text file. This should be supplied as a 4xN text file with each line is in the format [ X Y Z b ], where [ X Y Z ] describe the direction of the applied gradient, and b gives the b-value in units of s/mm^2. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. + +- **-fslgrad bvecs bvals** Provide the diffusion-weighted gradient scheme used in the acquisition in FSL bvecs/bvals format files. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. + +- **-bvalue_scaling mode** specifies whether the b-values should be scaled by the square of the corresponding DW gradient norm, as often required for multi-shell or DSI DW acquisition schemes. The default action can also be set in the MRtrix config file, under the BValueScaling entry. Valid choices are yes/no, true/false, 0/1 (default: true). + +DW shell selection options +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- **-shells list** specify one or more diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. + Standard options ^^^^^^^^^^^^^^^^ From 88b7eba8d20e2d10522f51425cbaa967c179f6ad Mon Sep 17 00:00:00 2001 From: Rami Tabbara Date: Fri, 6 Oct 2017 10:53:16 +1100 Subject: [PATCH 180/538] mrview: tract_geom: Enable downsampling just for pseudotubes --- src/gui/mrview/tool/tractography/tractogram.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/mrview/tool/tractography/tractogram.cpp b/src/gui/mrview/tool/tractography/tractogram.cpp index 4492279280..fdfe4f3696 100644 --- a/src/gui/mrview/tool/tractography/tractogram.cpp +++ b/src/gui/mrview/tool/tractography/tractogram.cpp @@ -578,7 +578,7 @@ namespace MR const float step_size = DWI::Tractography::get_step_size (properties); GLint new_stride = 1; - if (geometry_type != TrackGeometryType::Lines && std::isfinite (step_size)) { + if (geometry_type == TrackGeometryType::Pseudotubes && std::isfinite (step_size)) { const auto geom_size = geometry_type == TrackGeometryType::Pseudotubes ? Tractogram::default_line_thickness : Tractogram::default_point_size; new_stride = GLint (geom_size * std::exp (2.0e-3f * line_thickness) * original_fov / step_size); From 71e47cbcf0e65d84b6080e1bf22fd3b8ed2c405b Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 11 Oct 2017 09:20:02 +1100 Subject: [PATCH 181/538] fod2fixel: New option -maxnum This option sets the maximum number of fixels to store in any particular voxel. This is enforced at the output stage, rather than during the FOD segmentation algorithm itself. Also tweaked option grouping and the command synopsis. --- cmd/fod2fixel.cpp | 86 ++++++++++++--------------- docs/reference/commands/fod2fixel.rst | 13 ++-- docs/reference/commands_list.rst | 2 +- 3 files changed, 47 insertions(+), 54 deletions(-) diff --git a/cmd/fod2fixel.cpp b/cmd/fod2fixel.cpp index 50c4e3857b..e8e911874a 100644 --- a/cmd/fod2fixel.cpp +++ b/cmd/fod2fixel.cpp @@ -61,15 +61,15 @@ void usage () AUTHOR = "Robert E. Smith (robert.smith@florey.edu.au)"; - SYNOPSIS = "Use a fast-marching level-set method to segment fibre orientation distributions, and save parameters of interest as fixel images"; + SYNOPSIS = "Perform segmentation of continuous Fibre Orientation Distributions (FODs) to produce discrete fixels"; - REFERENCES + REFERENCES + "* Reference for the FOD segmentation method:\n" "Smith, R. E.; Tournier, J.-D.; Calamante, F. & Connelly, A. " // Internal "SIFT: Spherical-deconvolution informed filtering of tractograms. " "NeuroImage, 2013, 67, 298-312 (Appendix 2)" - + "* Reference for Apparent Fibre Density:\n" + + "* Reference for Apparent Fibre Density (AFD):\n" "Raffelt, D.; Tournier, J.-D.; Rose, S.; Ridgway, G.R.; Henderson, R.; Crozier, S.; Salvado, O.; Connelly, A. " // Internal "Apparent Fibre Density: a novel measure for the analysis of diffusion-weighted magnetic resonance images." "Neuroimage, 2012, 15;59(4), 3976-94."; @@ -81,14 +81,19 @@ void usage () OPTIONS - + Option ("mask", - "only perform computation within the specified binary brain mask image.") - + Argument ("image").type_image_in() - + OutputOptions + FMLSSegmentOption + + OptionGroup ("Other options for fod2fixel") + + + Option ("mask", + "only perform computation within the specified binary brain mask image.") + + Argument ("image").type_image_in() + + + Option ("maxnum", "maximum number of fixels to output for any particular voxel (default: no limit)") + + Argument ("number").type_integer(1) + + Option ("nii", "output the directions and index file in nii format (instead of the default mif)") + Option ("dirpeak", "define the fixel direction as the peak lobe direction as opposed to the lobe mean"); @@ -100,22 +105,18 @@ void usage () class Segmented_FOD_receiver { MEMALIGN(Segmented_FOD_receiver) public: - Segmented_FOD_receiver (const Header& header, bool dir_as_peak = false) : - H (header), n_fixels (0), dir_as_peak (dir_as_peak) - { - } + Segmented_FOD_receiver (const Header& header, const uint32_t maxnum = 0, bool dir_as_peak = false) : + H (header), fixel_count (0), max_per_voxel (maxnum), dir_as_peak (dir_as_peak) { } void commit (); void set_fixel_directory_output (const std::string& path) { fixel_directory_path = path; } void set_index_output (const std::string& path) { index_path = path; } void set_directions_output (const std::string& path) { dir_path = path; } - void set_afd_output (const std::string& path) { afd_path = path; } + void set_afd_output (const std::string& path) { afd_path = path; } void set_peak_output (const std::string& path) { peak_path = path; } void set_disp_output (const std::string& path) { disp_path = path; } - size_t num_outputs() const; - bool operator() (const FOD_lobes&); @@ -125,56 +126,45 @@ class Segmented_FOD_receiver { MEMALIGN(Segmented_FOD_receiver) Eigen::Vector3f dir; float integral; float peak_value; - Primitive_FOD_lobe (Eigen::Vector3f dir, float integral, float peak_value) - : dir (dir), integral (integral), peak_value (peak_value) {} + Primitive_FOD_lobe (Eigen::Vector3f dir, float integral, float peak_value) : + dir (dir), integral (integral), peak_value (peak_value) {} }; class Primitive_FOD_lobes : public vector { MEMALIGN (Primitive_FOD_lobes) public: - Eigen::Array3i vox; - - Primitive_FOD_lobes (const FOD_lobes& in, bool asdf) : vox (in.vox) + Primitive_FOD_lobes (const FOD_lobes& in, const uint32_t maxcount, bool use_peak_dir) : + vox (in.vox) { - for (const FOD_lobe& lobe : in) { - if (asdf) + const uint32_t N = maxcount ? std::min (uint32_t(in.size()), maxcount) : in.size(); + for (uint32_t i = 0; i != N; ++i) { + const FOD_lobe& lobe (in[i]); + if (use_peak_dir) this->emplace_back (lobe.get_peak_dir(0).cast(), lobe.get_integral(), lobe.get_max_peak_value()); else this->emplace_back (lobe.get_mean_dir().cast(), lobe.get_integral(), lobe.get_max_peak_value()); } } + Eigen::Array3i vox; }; Header H; std::string fixel_directory_path, index_path, dir_path, afd_path, peak_path, disp_path; vector lobes; - uint64_t n_fixels; + uint32_t fixel_count; + uint32_t max_per_voxel; bool dir_as_peak; }; -size_t Segmented_FOD_receiver::num_outputs() const -{ - size_t count = 1; - if (dir_path.size()) ++count; - if (afd_path.size()) ++count; - if (peak_path.size()) ++count; - if (disp_path.size()) ++count; - return count; -} - - - bool Segmented_FOD_receiver::operator() (const FOD_lobes& in) { - - if (size_t n = in.size()) { - lobes.emplace_back (in, dir_as_peak); - n_fixels += n; + if (in.size()) { + lobes.emplace_back (in, max_per_voxel, dir_as_peak); + fixel_count += lobes.back().size(); } - return true; } @@ -182,7 +172,7 @@ bool Segmented_FOD_receiver::operator() (const FOD_lobes& in) void Segmented_FOD_receiver::commit () { - if (!lobes.size() || !n_fixels || !num_outputs()) + if (!lobes.size() || !fixel_count) return; using DataImage = Image; @@ -197,7 +187,7 @@ void Segmented_FOD_receiver::commit () std::unique_ptr disp_image; auto index_header (H); - index_header.keyval()[Fixel::n_fixels_key] = str(n_fixels); + index_header.keyval()[Fixel::n_fixels_key] = str(fixel_count); index_header.ndim() = 4; index_header.size(3) = 2; index_header.datatype() = DataType::from(); @@ -206,7 +196,7 @@ void Segmented_FOD_receiver::commit () auto fixel_data_header (H); fixel_data_header.ndim() = 3; - fixel_data_header.size(0) = n_fixels; + fixel_data_header.size(0) = fixel_count; fixel_data_header.size(2) = 1; fixel_data_header.datatype() = DataType::Float32; fixel_data_header.datatype().set_byte_order_native(); @@ -289,7 +279,7 @@ void Segmented_FOD_receiver::commit () lobe_index ++; } - assert (offset == n_fixels); + assert (offset == fixel_count); } @@ -301,9 +291,10 @@ void run () Math::SH::check (H); auto fod_data = H.get_image(); - const bool dir_as_peak = get_options ("dirpeak").size() ? true : false; + const bool dir_as_peak = get_options ("dirpeak").size(); + const uint32_t maxnum = get_option_value ("maxnum", 0); - Segmented_FOD_receiver receiver (H, dir_as_peak); + Segmented_FOD_receiver receiver (H, maxnum, dir_as_peak); auto& fixel_directory_path = argument[1]; receiver.set_fixel_directory_output (fixel_directory_path); @@ -318,7 +309,7 @@ void run () receiver.set_directions_output (default_directions_filename); auto - opt = get_options ("afd"); if (opt.size()) receiver.set_afd_output (opt[0][0]); + opt = get_options ("afd"); if (opt.size()) receiver.set_afd_output (opt[0][0]); opt = get_options ("peak"); if (opt.size()) receiver.set_peak_output (opt[0][0]); opt = get_options ("disp"); if (opt.size()) receiver.set_disp_output (opt[0][0]); @@ -330,9 +321,6 @@ void run () throw Exception ("Cannot use image \"" + str(opt[0][0]) + "\" as mask image; dimensions do not match FOD image"); } - if (!receiver.num_outputs ()) - throw Exception ("Nothing to do; please specify at least one output image type"); - Fixel::check_fixel_directory (fixel_directory_path, true, true); FMLS::FODQueueWriter writer (fod_data, mask); diff --git a/docs/reference/commands/fod2fixel.rst b/docs/reference/commands/fod2fixel.rst index 8153b8bdbf..c122932a07 100644 --- a/docs/reference/commands/fod2fixel.rst +++ b/docs/reference/commands/fod2fixel.rst @@ -6,7 +6,7 @@ fod2fixel Synopsis -------- -Use a fast-marching level-set method to segment fibre orientation distributions, and save parameters of interest as fixel images +Perform segmentation of continuous Fibre Orientation Distributions (FODs) to produce discrete fixels Usage -------- @@ -21,8 +21,6 @@ Usage Options ------- -- **-mask image** only perform computation within the specified binary brain mask image. - Metric values for fixel-based sparse output images ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -43,6 +41,13 @@ FOD FMLS segmenter options - **-fmls_peak_ratio_to_merge value** specify the amplitude ratio between a sample and the smallest peak amplitude of the adjoining lobes, above which the lobes will be merged. This is the relative amplitude between the smallest of two adjoining lobes, and the 'bridge' between the two lobes. A value of 1.0 will never merge two peaks into a single lobe; a value of 0.0 will always merge lobes unless they are bisected by a zero crossing. Default: 1. +Other options for fod2fixel +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- **-mask image** only perform computation within the specified binary brain mask image. + +- **-maxnum number** maximum number of fixels to output for any particular voxel (default: no limit) + - **-nii** output the directions and index file in nii format (instead of the default mif) - **-dirpeak** define the fixel direction as the peak lobe direction as opposed to the lobe mean @@ -71,7 +76,7 @@ References * Reference for the FOD segmentation method:Smith, R. E.; Tournier, J.-D.; Calamante, F. & Connelly, A. SIFT: Spherical-deconvolution informed filtering of tractograms. NeuroImage, 2013, 67, 298-312 (Appendix 2) -* Reference for Apparent Fibre Density:Raffelt, D.; Tournier, J.-D.; Rose, S.; Ridgway, G.R.; Henderson, R.; Crozier, S.; Salvado, O.; Connelly, A. Apparent Fibre Density: a novel measure for the analysis of diffusion-weighted magnetic resonance images.Neuroimage, 2012, 15;59(4), 3976-94. +* Reference for Apparent Fibre Density (AFD):Raffelt, D.; Tournier, J.-D.; Rose, S.; Ridgway, G.R.; Henderson, R.; Crozier, S.; Salvado, O.; Connelly, A. Apparent Fibre Density: a novel measure for the analysis of diffusion-weighted magnetic resonance images.Neuroimage, 2012, 15;59(4), 3976-94. -------------- diff --git a/docs/reference/commands_list.rst b/docs/reference/commands_list.rst index 416e050f87..34e5a09ffd 100644 --- a/docs/reference/commands_list.rst +++ b/docs/reference/commands_list.rst @@ -157,7 +157,7 @@ List of MRtrix3 commands :ref:`fixelcrop`, "Crop/remove fixels from sparse fixel image using a binary fixel mask" :ref:`fixelreorient`, "Reorient fixel directions" :ref:`fod2dec`, "Generate FOD-based DEC maps, with optional panchromatic sharpening and/or luminance/perception correction" - :ref:`fod2fixel`, "Use a fast-marching level-set method to segment fibre orientation distributions, and save parameters of interest as fixel images" + :ref:`fod2fixel`, "Perform segmentation of continuous Fibre Orientation Distributions (FODs) to produce discrete fixels" :ref:`label2colour`, "Convert a parcellated image (where values are node indices) into a colour image" :ref:`label2mesh`, "Generate meshes from a label image" :ref:`labelconvert`, "Convert a connectome node image from one lookup table to another" From 8dcfe5273642ea711ab56dff15bcc9c18af92c94 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 11 Oct 2017 09:35:44 +1100 Subject: [PATCH 182/538] TmpFileDir: Fix descriptioin of behaviour Adjust both the description of the config file entry, and the error message if failing to create a temporary file, to reflect the actual behaviour of the software. --- core/file/utils.h | 35 ++++++++++++++------------ docs/reference/config_file_options.rst | 2 +- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/core/file/utils.h b/core/file/utils.h index 3360e70b41..563a4a64e3 100644 --- a/core/file/utils.h +++ b/core/file/utils.h @@ -46,11 +46,14 @@ namespace MR //CONF option: TmpFileDir //CONF default: `/tmp` (on Unix), `.` (on Windows) //CONF The prefix for temporary files (as used in pipelines). By default, - //CONF these files get written to the current folder, which may cause - //CONF performance issues when operating over distributed file systems. - //CONF In this case, it may be better to specify `/tmp/` here. + //CONF these files get written to the current folder on Windows machines, + //CONF which may cause performance issues, particularly when operating + //CONF over distributed file systems. On Unix machines, the default is + //CONF /tmp/, which is typically a RAM file system and should therefore + //CONF be fast; but may cause issues on machines with little RAM + //CONF capacity or where write-access to this location is not permitted. const std::string& tmpfile_dir () { - static const std::string __tmpfile_dir = File::Config::get ("TmpFileDir", + static const std::string __tmpfile_dir = File::Config::get ("TmpFileDir", #ifdef MRTRIX_WINDOWS "." #else @@ -68,10 +71,10 @@ namespace MR //CONF suffix (depending on file type). Note that this prefix can also be //CONF manipulated using the `MRTRIX_TMPFILE_PREFIX` environment //CONF variable, without editing the config file. - const std::string __get_tmpfile_prefix () { + const std::string __get_tmpfile_prefix () { const char* from_env = getenv ("MRTRIX_TMPFILE_PREFIX"); if (from_env) return from_env; - return File::Config::get ("TmpFilePrefix", "mrtrix-tmp-"); + return File::Config::get ("TmpFilePrefix", "mrtrix-tmp-"); } const std::string& tmpfile_prefix () { @@ -110,7 +113,7 @@ namespace MR int fid = open (filename.c_str(), O_CREAT | O_RDWR | ( App::overwrite_files ? O_TRUNC : O_EXCL ), 0666); if (fid < 0) { - if (App::check_overwrite_files_func && errno == EEXIST) + if (App::check_overwrite_files_func && errno == EEXIST) App::check_overwrite_files_func (filename); else if (errno == EEXIST) throw Exception ("output file \"" + filename + "\" already exists (use -force option to force overwrite)"); @@ -120,7 +123,7 @@ namespace MR } if (fid < 0) { std::string mesg ("error creating file \"" + filename + "\": " + strerror (errno)); - if (errno == EEXIST) + if (errno == EEXIST) mesg += " (use -force option to force overwrite)"; throw Exception (mesg); } @@ -128,7 +131,7 @@ namespace MR if (size) size = ftruncate (fid, size); close (fid); - if (size) + if (size) throw Exception ("cannot resize file \"" + filename + "\": " + strerror (errno)); } @@ -152,10 +155,10 @@ namespace MR inline bool is_tempfile (const std::string& name, const char* suffix = NULL) { - if (Path::basename (name).compare (0, tmpfile_prefix().size(), tmpfile_prefix())) + if (Path::basename (name).compare (0, tmpfile_prefix().size(), tmpfile_prefix())) return false; - if (suffix) - if (!Path::has_suffix (name, suffix)) + if (suffix) + if (!Path::has_suffix (name, suffix)) return false; return true; } @@ -179,7 +182,7 @@ namespace MR } while (fid < 0 && errno == EEXIST); if (fid < 0) - throw Exception (std::string ("error creating temporary file in current working directory: ") + strerror (errno)); + throw Exception (std::string ("error creating temporary file in directory \"" + tmpfile_dir() + "\": ") + strerror (errno)); @@ -191,7 +194,7 @@ namespace MR } - inline void mkdir (const std::string& folder) + inline void mkdir (const std::string& folder) { if (::mkdir (folder.c_str() #ifndef MRTRIX_WINDOWS @@ -201,7 +204,7 @@ namespace MR throw Exception ("error creating folder \"" + folder + "\": " + strerror (errno)); } - inline void unlink (const std::string& file) + inline void unlink (const std::string& file) { if (::unlink (file.c_str())) throw Exception ("error deleting file \"" + file + "\": " + strerror (errno));; @@ -216,7 +219,7 @@ namespace MR std::string path = Path::join (folder, entry); if (Path::is_dir (path)) rmdir (path, true); - else + else unlink (path); } } diff --git a/docs/reference/config_file_options.rst b/docs/reference/config_file_options.rst index 8688aa72cf..fc11a7a696 100644 --- a/docs/reference/config_file_options.rst +++ b/docs/reference/config_file_options.rst @@ -407,7 +407,7 @@ List of MRtrix3 configuration file options * **TmpFileDir** *default: `/tmp` (on Unix), `.` (on Windows)* - The prefix for temporary files (as used in pipelines). By default, these files get written to the current folder, which may cause performance issues when operating over distributed file systems. In this case, it may be better to specify `/tmp/` here. + The prefix for temporary files (as used in pipelines). By default, these files get written to the current folder on Windows machines, which may cause performance issues, particularly when operating over distributed file systems. On Unix machines, the default is /tmp/, which is typically a RAM file system and should therefore be fast; but may cause issues on machines with little RAM capacity or where write-access to this location is not permitted. * **TmpFilePrefix** *default: `mrtrix-tmp-`* From 60b47f72746f41fb83a69921995a7b8e1ae385e7 Mon Sep 17 00:00:00 2001 From: Max Pietsch Date: Tue, 17 Oct 2017 13:30:15 +0100 Subject: [PATCH 183/538] mrview: overlay load: select last image so that other command line parameters apply only to the last image loaded --- src/gui/mrview/tool/overlay.cpp | 47 ++++++++++++++++++--------------- src/gui/mrview/tool/overlay.h | 6 ++--- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/gui/mrview/tool/overlay.cpp b/src/gui/mrview/tool/overlay.cpp index 15a85ca2ec..acf4076c36 100644 --- a/src/gui/mrview/tool/overlay.cpp +++ b/src/gui/mrview/tool/overlay.cpp @@ -35,14 +35,14 @@ namespace MR class Overlay::Item : public Image { MEMALIGN(Overlay::Item) public: Item (MR::Header&& H) : Image (std::move (H)) { } - Mode::Slice::Shader slice_shader; + Mode::Slice::Shader slice_shader; }; - class Overlay::Model : public ListModelBase + class Overlay::Model : public ListModelBase { MEMALIGN(Overlay::Model) public: - Model (QObject* parent) : + Model (QObject* parent) : ListModelBase (parent) { } void add_items (vector>& list); @@ -59,7 +59,7 @@ namespace MR for (size_t i = 0; i < list.size(); ++i) { Item* overlay = new Item (std::move (*list[i])); overlay->set_allowed_features (true, true, false); - if (!overlay->colourmap) + if (!overlay->colourmap) overlay->colourmap = 1; overlay->alpha = 1.0f; overlay->set_use_transparency (true); @@ -72,7 +72,7 @@ namespace MR Overlay::Overlay (Dock* parent) : - Base (parent) { + Base (parent) { VBoxLayout* main_box = new VBoxLayout (this); HBoxLayout* layout = new HBoxLayout; layout->setContentsMargins (0, 0, 0, 0); @@ -210,14 +210,17 @@ namespace MR - void Overlay::add_images (vector>& list) + void Overlay::add_images (vector>& list, bool clear) { size_t previous_size = image_list_model->rowCount(); image_list_model->add_items (list); QModelIndex first = image_list_model->index (previous_size, 0, QModelIndex()); QModelIndex last = image_list_model->index (image_list_model->rowCount()-1, 0, QModelIndex()); - image_list_view->selectionModel()->select (QItemSelection (first, last), QItemSelectionModel::Select); + if (clear) + image_list_view->selectionModel()->select (QItemSelection (first, last), QItemSelectionModel::ClearAndSelect); + else + image_list_view->selectionModel()->select (QItemSelection (first, last), QItemSelectionModel::Select); } @@ -258,7 +261,7 @@ namespace MR } - void Overlay::hide_all_slot () + void Overlay::hide_all_slot () { updateGL(); } @@ -283,7 +286,7 @@ namespace MR Overlay::Item* image = dynamic_cast(image_list_model->items[i].get()); need_to_update |= !std::isfinite (image->intensity_min()); image->transparent_intensity = image->opaque_intensity = image->intensity_min(); - if (is_3D) + if (is_3D) window().get_current_mode()->overlays_for_3D.push_back (image); else image->render3D (image->slice_shader, projection, projection.depth_of (window().focus())); @@ -574,7 +577,7 @@ namespace MR - void Overlay::update_selection () + void Overlay::update_selection () { QModelIndexList indices = image_list_view->selectionModel()->selectedIndexes(); volume_label->setEnabled (false); @@ -609,7 +612,7 @@ namespace MR if (colourmap_index != int(overlay->colourmap)) { if (colourmap_index == -2) colourmap_index = overlay->colourmap; - else + else colourmap_index = -1; } rate += overlay->scaling_rate(); @@ -618,11 +621,11 @@ namespace MR num_lower_threshold += overlay->use_discard_lower(); num_upper_threshold += overlay->use_discard_upper(); opacity += overlay->alpha; - if (overlay->interpolate()) + if (overlay->interpolate()) ++num_interp; if (!std::isfinite (overlay->lessthan)) overlay->lessthan = overlay->intensity_min(); - if (!std::isfinite (overlay->greaterthan)) + if (!std::isfinite (overlay->greaterthan)) overlay->greaterthan = overlay->intensity_max(); lower_threshold_val += overlay->lessthan; upper_threshold_val += overlay->greaterthan; @@ -654,7 +657,7 @@ namespace MR interpolate_check_box->setCheckState (Qt::Unchecked); else if (num_interp == indices.size()) interpolate_check_box->setCheckState (Qt::Checked); - else + else interpolate_check_box->setCheckState (Qt::PartiallyChecked); min_value->setRate (rate); @@ -666,7 +669,7 @@ namespace MR lower_threshold_check_box->setCheckState (num_lower_threshold ? ( num_lower_threshold == indices.size() ? Qt::Checked : - Qt::PartiallyChecked ) : + Qt::PartiallyChecked ) : Qt::Unchecked); lower_threshold->setRate (rate); @@ -674,7 +677,7 @@ namespace MR upper_threshold_check_box->setCheckState (num_upper_threshold ? ( num_upper_threshold == indices.size() ? Qt::Checked : - Qt::PartiallyChecked ) : + Qt::PartiallyChecked ) : Qt::Unchecked); upper_threshold->setRate (rate); } @@ -682,8 +685,8 @@ namespace MR - void Overlay::add_commandline_options (MR::App::OptionList& options) - { + void Overlay::add_commandline_options (MR::App::OptionList& options) + { using namespace MR::App; options + OptionGroup ("Overlay tool options") @@ -700,16 +703,16 @@ namespace MR + Option ("overlay.colourmap", "Sets the colourmap of the overlay as indexed in the colourmap dropdown menu.").allow_multiple() + Argument ("index").type_integer(); - + } - bool Overlay::process_commandline_option (const MR::App::ParsedOption& opt) + bool Overlay::process_commandline_option (const MR::App::ParsedOption& opt) { if (opt.opt->is ("overlay.load")) { vector> list; try { list.push_back (make_unique (MR::Header::open (opt[0]))); } catch (Exception& e) { e.display(); } - add_images (list); + add_images (list, true); return true; } @@ -742,7 +745,7 @@ namespace MR catch (Exception& e) { e.display(); } return true; } - + return false; } diff --git a/src/gui/mrview/tool/overlay.h b/src/gui/mrview/tool/overlay.h index de3878c154..8102c35ece 100644 --- a/src/gui/mrview/tool/overlay.h +++ b/src/gui/mrview/tool/overlay.h @@ -99,12 +99,12 @@ namespace MR QSlider *opacity_slider; void update_selection (); - void updateGL() { + void updateGL() { window().get_current_mode()->update_overlays = true; window().updateGL(); } - - void add_images (vector>& list); + + void add_images (vector>& list, bool clear = false); void dropEvent (QDropEvent* event) override; }; From 7a086111433d184649bea285a2ac3896d0684feb Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 18 Oct 2017 17:42:35 +1100 Subject: [PATCH 184/538] Docs: Page on PE scheme handling Closes #1065. --- docs/concepts/pe_scheme.rst | 187 +++++++++++++++++++++++++++++++++++ docs/index.rst | 1 + docs/troubleshooting/FAQ.rst | 4 +- 3 files changed, 190 insertions(+), 2 deletions(-) create mode 100644 docs/concepts/pe_scheme.rst diff --git a/docs/concepts/pe_scheme.rst b/docs/concepts/pe_scheme.rst new file mode 100644 index 0000000000..705e2b9876 --- /dev/null +++ b/docs/concepts/pe_scheme.rst @@ -0,0 +1,187 @@ +Phase encoding scheme handling +============================== + +From version 3.0RC1 onwards, *MRtrix3* is capable of importing information from +DICOM relating to the phase encoding of the acquired images, and encoding this +information within key-value fields inside an image header. This information can +then later be used by the ``dwipreproc`` script, specifically using its +``-rpe_header`` command-line option, to automatically set up and execute FSL's +``topup`` and ``eddy`` commands without requiring explicit input from the user +regarding the phase encoding design of the imaging experiment. This page +explains how this information is encoded and manipulated by *MRtrix3*. + + +.. NOTE:: + + Due to variations in sequences, acquisition protocols, DICOM encoding, and + image manipulation operations, *MRtrix3* cannot be guaranteed to obtain or + retain the phase encoding information correctly in all circumstances. Manual + inspection of these data and/or the outcomes of image processing when making + use of these data is advocated. If circumstances leading to incorrect import + or encoding of this information in *MRtrix3* is reproducible, please report + this to the *MRtrix3* developers so that the software can be updated to + support such data. + + +Phase encoding information storage +---------------------------------- + +The phase encoding information for a particular image file can be stored in one +of two ways. + +- The most convenient of these is storage of (one or more) key-value field(s) + encapsulated within the :ref:`image_header`, just as can be used for + :ref:`diffusion_gradient_scheme_handling`. This ensures that the information + is retained through image processing, as each *MRtrix3* command passes the + header entries of the input image through to the output image. + +- Alternatively, this information can be stored within a JSON file that + accompanies the relevant image file(s). This information would then typically + be imported / exported using the ``-json_import`` and ``-json_export`` options + in ``mrconvert``. + +Precisely *how* this phase encoding information is *encoded* however depends on +the nature of the phase encoding information for that image; specifically, +whether the phase encoding information is *identical* for all volumes within an +image file (or if it contains just one volume), or whether the phase encoding +information *varies* between volumes within the image series. + + +Fixed phase encoding +.................... + +In the case where both the phase encoding *direction* and the EPI *total readout +time* are equivalent for all volumes within an image, this information is encoded +within two fields: "``PhaseEncodingDirection``" and "``TotalReadoutTime``". These +fields are consistent with `BIDS +`_ (the Brain Imaging Data Structure). + +``PhaseEncodingDrection`` can take one of six values: "``i``", "``i-``", "``j``", +"``j-``", "``k``", ``k-``. These correspond to the first, second and third axes of +the corresponding image, using the RAS (Right-Anterior-Superior) convention common +to both NIfTI and *MRtrix3*. For example: If the phase encoding is applied A>>P +(anterior-posterior), this is the *second* spatial axis, but the phase encoding is +also *reversed* along that axis ("RAS" indicates voxel positions in the second +axis *increasing* when moving toward the anterior of the brain, whereas "A>>P" +indicates the opposite); hence in this example ``PhaseEncodingDirection`` would +have the value "``j-``". + +.. NOTE:: + + The phase encoding direction is defined specifically with respect to *image + axes*. It is therefore *not* affected by the image *strides*, which only affect + how the data for these axes are arranged when they are stored as a + one-dimensional list of values. + + The phase encoding direction also does *not* relate to "``x``", "``y``" and + "``z``" axis directions in "real" / "scanner" space, as do other + representations of orientation information in *MRtrix3*. This is because phase + encoding specifically affects the appearance of the image along the image axis + in which phase encoding was applied; for instance, if the image were to be + rotated, the EPI field inhomogeneity distortions would still align with the + relevant image axis after this rotation, whereas in real-space the effective + direction of phase encoding would have changed. + +``TotalReadoutTime`` provides the total time required for the EPI readout train. +Specifically, this is the time between the centre of the first echo, and the centre +of the last echo, in the train; this is consistent with BIDS, and is sometimes +referred to as the "FSL definition", since it is consistent with relevant +calculations performed within FSL tools. It should be defined in seconds. + + +Variable phase encoding +....................... + +If the phase encoding direction and/or the total readout time varies between +different volumes within a single image series, then the two key-value fields +described above are not sufficient to fully encode this information. In this +situation, *MRtrix3* will instead use a key-value entry "``pe_scheme``" (similar to +the "``dw_scheme``" entry used for :ref:`diffusion_gradient_scheme_handling`). + +This information is stored as a *table*, where each row contains the phase encoding +direction and the readout time for the corresponding volume; the number of rows in +this table must therefore be equal to the number of volumes in the image. In each +row, the first three numbers encode the phase encoding direction, and the fourth +number is the total readout time. The direction is specified as a unit direction in +the image coordinate system; for instance, a phase encoding direction of A>>P would +be encoded as ``[ 0 -1 0 ]``. + + +Manipulation of phase encoding data +----------------------------------- + +The primary purpose of storing this phase encoding information is to automate the +correction of EPI susceptibility distortions. However this can only occur if the +information stored is not invalidated through the manipulation of the corresponding +image data. Therefore, any *MRtrix3* command that is capable of manipulating the +image data in such a way as to invalidate the phase encoding information will +*automatically* modify this phase encoding information appropriately. This includes +modifying the representation of this information between the fixed and variable +phase encoding cases. + +Consider, for instance, a pair of *b*=0 images, where the first was acquired with +phase encoding direction ``A>>P``, and the second was acquired using phase encoding +direction ``P>>A``:: + + $ mrinfo AP.mif + ****************************** + Image: AP.mif + ****************************** + ... + PhaseEncodingDirection: j- + TotalReadoutTime: 0.0575 + ... + + $ mrinfo PA.mif + ****************************** + Image: PA.mif + ****************************** + ... + PhaseEncodingDirection: j + TotalReadoutTime: 0.0575 + ... + +Now watch what happens when we concatenate these two images together:: + + $ mrcat AP.mif PA.mif AP_PA_pair.mif -axis 3 + mrcat: [100%] concatenating "AP.mif" + mrcat: [100%] concatenating "PA.mif" + # mrinfo AP_PA_pair.mif + ****************************** + Image: AP_PA_pair.mif + ****************************** + ... + pe_scheme: 0,-1,0,0.0575 + 0,1,0,0.0575 + ... + +When the two input images are concatenated, *MRtrix3* additionally concatenates the +phase encoding information of the input volumes; since it detects that these are not +consistent between volumes, it stores this information using the ``pe_scheme`` header +entry, rather than ``PhaseEncodingDirection`` and ``TotalReadoutTime``. + +The ``mrconvert`` command has a number of additional functionalities that can be used +to manipulate this information: + +- The ``-import_pe_table`` and ``-export_pe_table`` options can be used to + import/export the phase encoding information from / to file as a table, i.e. in + the format used for the ``pe_scheme`` header entry described above. Note that even + if all volumes in the image have the same phase encoding direction and total + readout time, these options will still import / export these data in table format. + +- The ``-import_pe_eddy`` and ``-export_pe_eddy`` options can be used to + import/export the phase encoding information in the format required by FSL's + ``eddy`` tool. The `FSL documentation page `_ + describes this format in more detail. + +- The ``-json_import`` and ``-json_export`` options can be used to import/export + *all* header key-value entries from/to an external JSON file. This may be useful + in particular for operating within the BIDS specification. There is a caveat here: + If you use the ``-json_export`` option on an image with *fixed* phase encoding, + the ``PhaseEncodingDirection`` and ``TotalReadoutTime`` fields will be written as + expected by BIDS; however if the image contains *variable* phase eocnding, then + the ``pe_scheme`` header entry will be written to the JSON file, and this will not + be appropriately interpreted by other BIDS tools. + +- The ``-set_property`` option may be useful to *override* these header entries if + they are deemed incorrect by some other source of information. diff --git a/docs/index.rst b/docs/index.rst index bcc3780da1..6d517d24b9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -93,6 +93,7 @@ These applications have been written from scratch in C++, using the functionalit :caption: Concepts concepts/dw_scheme + concepts/pe_scheme concepts/global_intensity_normalisation concepts/orthonormal_sh_basis concepts/sh_basis_lmax diff --git a/docs/troubleshooting/FAQ.rst b/docs/troubleshooting/FAQ.rst index c52e54e2f9..3ce04b834b 100644 --- a/docs/troubleshooting/FAQ.rst +++ b/docs/troubleshooting/FAQ.rst @@ -371,12 +371,12 @@ so coarse that it is impossible to find any voxels that are entirely encapsulated by the surface corresponding to the segmented structure, resulting in an error within the FIRST script. -If this is the case, it is highly recommended that the T1 image _not_ be +If this is the case, it is highly recommended that the T1 image *not* be resampled to the DWI voxel grid following registration; not only for the issue mentioned above, but also because ACT is explicitly designed to take full advantage of the higher spatial resolution of the T1 image. If ``flirt`` is still to be used for registration, the solution is to instruct -``flirt`` to provide a _transformation matrix_, rather than a translated & +``flirt`` to provide a *transformation matrix*, rather than a translated & resampled image: .. code-block: console From 748e1eb39b5d707c0b1807796b2fdc3857694591 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Thu, 19 Oct 2017 11:55:25 +1100 Subject: [PATCH 185/538] dwiintensitynorm default FA threshold reported in option help text --- bin/dwiintensitynorm | 2 +- docs/reference/scripts/dwiintensitynorm.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/dwiintensitynorm b/bin/dwiintensitynorm index 0c0ab4db0e..c4d7a653d3 100755 --- a/bin/dwiintensitynorm +++ b/bin/dwiintensitynorm @@ -39,7 +39,7 @@ app.cmdline.add_argument('output_dir', help='The output directory containing all app.cmdline.add_argument('fa_template', help='The output population specific FA template, which is threshold to estimate a white matter mask') app.cmdline.add_argument('wm_mask', help='The output white matter mask (in template space), used to estimate the median b=0 white matter value for normalisation') options = app.cmdline.add_argument_group('Options for the dwiintensitynorm script') -options.add_argument('-fa_threshold', default='0.4', help='The threshold applied to the Fractional Anisotropy group template used to derive an approximate white matter mask') +options.add_argument('-fa_threshold', default='0.4', help='The threshold applied to the Fractional Anisotropy group template used to derive an approximate white matter mask (default: 0.4)') app.parse() app.args.input_dir = relpath(app.args.input_dir) diff --git a/docs/reference/scripts/dwiintensitynorm.rst b/docs/reference/scripts/dwiintensitynorm.rst index 6bb644df1d..eb808672b3 100644 --- a/docs/reference/scripts/dwiintensitynorm.rst +++ b/docs/reference/scripts/dwiintensitynorm.rst @@ -32,7 +32,7 @@ Options Options for the dwiintensitynorm script ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-fa_threshold** The threshold applied to the Fractional Anisotropy group template used to derive an approximate white matter mask +- **-fa_threshold** The threshold applied to the Fractional Anisotropy group template used to derive an approximate white matter mask (default: 0.4) Standard options ^^^^^^^^^^^^^^^^ From 4870c12238841128d7c5ef76c17ff1a688d60b77 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 19 Oct 2017 16:31:04 +1100 Subject: [PATCH 186/538] DICOM import: Capture slice timing The time of acquisition of individual slices may come from one of three sources: - If the image is stored in mosaic format, the Siemens CCSA field 'MosaicRefAcqTimes' will be used. - If the Siemens CSA field 'TimeAfterStart' is present, it will be used for all frames in the first volume to determine the slice timing. - Otherwise, the DICOM field 'AcquisitionTime' will be used to determine the slice timing. Note that the last of these three additionally requires rarsing of the DICOM time format; therefore, all standard date and time fields in DICOM will now be explicitly converted and displayed as such. Relates to #1169. --- core/file/dicom/csa_entry.h | 50 ++++++++---- core/file/dicom/element.cpp | 71 +++++++++++++++-- core/file/dicom/element.h | 46 ++++++++++- core/file/dicom/image.cpp | 155 +++++++++++++++++++----------------- core/file/dicom/image.h | 30 +++---- core/file/dicom/mapper.cpp | 95 ++++++++++++++++------ core/mrtrix.h | 53 +++++++----- 7 files changed, 346 insertions(+), 154 deletions(-) diff --git a/core/file/dicom/csa_entry.h b/core/file/dicom/csa_entry.h index 07a0c1f5f2..e51968a1ef 100644 --- a/core/file/dicom/csa_entry.h +++ b/core/file/dicom/csa_entry.h @@ -17,6 +17,7 @@ #include "datatype.h" #include "raw.h" +#include "types.h" #include "file/dicom/element.h" namespace MR { @@ -29,7 +30,7 @@ namespace MR { start (start_p), end (end_p), print (output_fields) { - if (strncmp ("SV10", (const char*) start, 4)) + if (strncmp ("SV10", (const char*) start, 4)) DEBUG ("WARNING: CSA data is not in SV10 format"); cnum = 0; @@ -39,32 +40,32 @@ namespace MR { bool parse () { - if (cnum >= num) + if (cnum >= num) return false; start = next; - if (start >= end + 84) + if (start >= end + 84) return false; strncpy (name, (const char*) start, 64); Raw::fetch_LE (start+64); // vm strncpy (vr, (const char*) start+68, 4); Raw::fetch_LE (start+72); // syngodt nitems = Raw::fetch_LE (start+76); - if (print) + if (print) fprintf (stdout, " [CSA] %s: ", name); next = start + 84; - if (next + 4 >= end) + if (next + 4 >= end) return false; for (uint32_t m = 0; m < nitems; m++) { uint32_t length = Raw::fetch_LE (next); size_t size = 16 + 4*((length+3)/4); - if (next + size > end) + if (next + size > end) return false; - if (print) + if (print) fprintf (stdout, "%.*s ", length, (const char*) next+16); next += size; } - if (print) + if (print) fprintf (stdout, "\n"); cnum++; @@ -72,11 +73,11 @@ namespace MR { } const char* key () const { return (name); } - int get_int () const { + int get_int () const { const uint8_t* p = start + 84; for (uint32_t m = 0; m < nitems; m++) { uint32_t length = Raw::fetch_LE (p); - if (length) + if (length) return to (std::string (reinterpret_cast (p)+16, 4*((length+3)/4))); p += 16 + 4*((length+3)/4); } @@ -87,31 +88,50 @@ namespace MR { const uint8_t* p = start + 84; for (uint32_t m = 0; m < nitems; m++) { uint32_t length = Raw::fetch_LE (p); - if (length) + if (length) return to (std::string (reinterpret_cast (p)+16, 4*((length+3)/4))); p += 16 + 4*((length+3)/4); } - return NAN; + return NaN; } void get_float (Eigen::Vector3& v) const { const uint8_t* p = start + 84; for (uint32_t m = 0; m < nitems; m++) { uint32_t length = Raw::fetch_LE (p); - if (length) + if (length) { + if (m > 2) + throw Exception ("Attempting to load 3-vector from CSA entry \"" + str(name) + "\" that contains non-empty data at index " + str(m)); v[m] = to (std::string (reinterpret_cast (p)+16, 4*((length+3)/4))); + } else if (m < 3) { + WARN ("Loading 3-vector from CSA entry \"" + str(name) + "\", but no data provided for index " + str(m)); + v[m] = NaN; + } + p += 16 + 4*((length+3)/4); + } + } + + void get_float (vector& v) const { + v.resize (nitems); + const uint8_t* p = start + 84; + for (uint32_t m = 0; m < nitems; m++) { + uint32_t length = Raw::fetch_LE (p); + if (length) + v[m] = to (std::string (reinterpret_cast (p)+16, 4*((length+3)/4))); + else + v[m] = NaN; p += 16 + 4*((length+3)/4); } } friend std::ostream& operator<< (std::ostream& stream, const CSAEntry& item) { - stream << "[CSA] " << item.name << ":"; + stream << "[CSA] " << item.name << " (" + str(item.nitems) + " items):"; const uint8_t* next = item.start + 84; for (uint32_t m = 0; m < item.nitems; m++) { uint32_t length = Raw::fetch_LE (next); size_t size = 16 + 4*((length+3)/4); - while (length > 0 && !next[16+length-1]) + while (length > 0 && !next[16+length-1]) length--; stream << " "; stream.write (reinterpret_cast (next)+16, length); diff --git a/core/file/dicom/element.cpp b/core/file/dicom/element.cpp index e34bbb4ce0..07eed258f4 100644 --- a/core/file/dicom/element.cpp +++ b/core/file/dicom/element.cpp @@ -20,6 +20,35 @@ namespace MR { namespace File { namespace Dicom { + + + std::ostream& operator<< (std::ostream& stream, const Date& item) + { + stream << item.year << "/" + << std::setfill('0') << std::setw(2) << item.month << "/" + << std::setfill('0') << std::setw(2) << item.day; + return stream; + } + + + + + + std::ostream& operator<< (std::ostream& stream, const Time& item) + { + stream << std::setfill('0') << std::setw(2) << item.hour << ":" + << std::setfill('0') << std::setw(2) << item.minute << ":" + << std::setfill('0') << std::setw(2) << item.second; + if (item.fraction) + stream << str(item.fraction, 6).substr(1); + return stream; + } + + + + + + void Element::set (const std::string& filename, bool force_read, bool read_write) { group = element = VR = 0; @@ -160,7 +189,7 @@ namespace MR { next = data; if (size == LENGTH_UNDEFINED) { - if (VR != VR_SQ && !(group == GROUP_SEQUENCE && element == ELEMENT_SEQUENCE_ITEM)) + if (VR != VR_SQ && !(group == GROUP_SEQUENCE && element == ELEMENT_SEQUENCE_ITEM)) INFO ("undefined length used for DICOM tag " + ( tag_name().size() ? tag_name().substr (2) : "" ) + MR::printf ("(%04X, %04X) in file \"", group, element) + fmap->name() + "\""); } @@ -182,9 +211,9 @@ namespace MR { - if (parents.size()) + if (parents.size()) if ((parents.back().end && data > parents.back().end) || - (group == GROUP_SEQUENCE && element == ELEMENT_SEQUENCE_DELIMITATION_ITEM)) + (group == GROUP_SEQUENCE && element == ELEMENT_SEQUENCE_DELIMITATION_ITEM)) parents.pop_back(); if (is_new_sequence()) { @@ -248,10 +277,12 @@ namespace MR { if (VR == VR_SL || VR == VR_SS) return INT; if (VR == VR_UL || VR == VR_US) return UINT; if (VR == VR_SQ) return SEQ; - if (VR == VR_AE || VR == VR_AS || VR == VR_CS || VR == VR_DA || + if (VR == VR_DA) return DATE; + if (VR == VR_TM) return TIME; + if (VR == VR_AE || VR == VR_AS || VR == VR_CS || VR == VR_DS || VR == VR_DT || VR == VR_IS || VR == VR_LO || VR == VR_LT || VR == VR_PN || VR == VR_SH || VR == VR_ST || - VR == VR_TM || VR == VR_UI || VR == VR_UT || VR == VR_AT) return STRING; + VR == VR_UI || VR == VR_UT || VR == VR_AT) return STRING; return OTHER; } @@ -302,9 +333,9 @@ namespace MR { - vector Element::get_float () const + vector Element::get_float () const { - vector V; + vector V; if (VR == VR_FD) for (const uint8_t* p = data; p < data + size; p += sizeof (float64)) V.push_back (Raw::fetch_ (p, is_BE)); @@ -315,7 +346,7 @@ namespace MR { vector strings (split (std::string (reinterpret_cast (data), size), "\\", false)); V.resize (strings.size()); for (size_t n = 0; n < V.size(); n++) - V[n] = to (strings[n]); + V[n] = to (strings[n]); } else report_unknown_tag_with_implicit_syntax(); @@ -325,6 +356,24 @@ namespace MR { + Date Element::get_date () const + { + assert (type() == DATE); + return Date (std::string (reinterpret_cast (data), size)); + } + + + + + Time Element::get_time () const + { + assert (type() == TIME); + return Time (std::string (reinterpret_cast (data), size)); + } + + + + vector Element::get_string () const { @@ -396,6 +445,12 @@ namespace MR { case Element::FLOAT: stream << item.get_float(); break; + case Element::DATE: + stream << "[ " << item.get_date() << " ]"; + break; + case Element::TIME: + stream << "[ " << item.get_time() << " ]"; + break; case Element::STRING: if (item.group == GROUP_DATA && item.element == ELEMENT_DATA) stream << "(data)"; diff --git a/core/file/dicom/element.h b/core/file/dicom/element.h index d63f0aca2e..1e249275b8 100644 --- a/core/file/dicom/element.h +++ b/core/file/dicom/element.h @@ -35,6 +35,46 @@ namespace MR { uint8_t* end; }; + class Date { NOMEMALIGN + public: + Date (const std::string& entry) : + year (to (entry.substr (0, 4))), + month (to (entry.substr (4, 2))), + day (to (entry.substr (6, 2))) + { + if (year < 1000 || month > 12 || day > 31) + throw Exception ("Error converting string \"" + entry + "\" to date"); + } + uint32_t year, month, day; + friend std::ostream& operator<< (std::ostream& stream, const Date& item); + }; + + class Time { NOMEMALIGN + public: + Time (const std::string& entry) : + hour (to (entry.substr (0, 2))), + minute (to (entry.substr (2, 2))), + second (to (entry.substr (4, 2))), + fraction (entry.size() > 6 ? to (entry.substr (6)) : 0.0) { } + Time (default_type i) + { + if (i < 0.0) + throw Exception ("Error converting negative floating-point number to a time"); + hour = std::floor (i / 3600.0); i -= hour * 3600.0; + if (hour >= 24) + throw Exception ("Error converting floating-point number to a time: Beyond 24 hours"); + minute = std::floor (i / 60.0); i -= minute * 60; + second = std::floor (i); + fraction = i - second; + } + Time () : hour (0), minute (0), second (0), fraction (0.0) { } + operator default_type() const { return (hour*3600.0 + minute*60 + second + fraction); } + Time operator- (const Time& t) const { return Time (default_type (*this) - default_type (t)); } + uint32_t hour, minute, second; + default_type fraction; + friend std::ostream& operator<< (std::ostream& stream, const Time& item); + }; + @@ -46,6 +86,8 @@ namespace MR { INT, UINT, FLOAT, + DATE, + TIME, STRING, SEQ, OTHER @@ -97,7 +139,9 @@ namespace MR { Type type () const; vector get_int () const; vector get_uint () const; - vector get_float () const; + vector get_float () const; + Date get_date () const; + Time get_time () const; vector get_string () const; size_t level () const { return parents.size(); } diff --git a/core/file/dicom/image.cpp b/core/file/dicom/image.cpp index ef52fe6ed3..b4187b07d1 100644 --- a/core/file/dicom/image.cpp +++ b/core/file/dicom/image.cpp @@ -33,7 +33,7 @@ namespace MR { if (item.parents[n].group == 0x5200U && ( item.parents[n].element == 0x9230U || // per-frame tag item.parents[n].element == 0x9229U)) { // shared across frames tag - is_toplevel = true; + is_toplevel = true; break; } } @@ -43,40 +43,48 @@ namespace MR { // process image-specific or per-frame items here: if (is_toplevel) { switch (item.group) { - case 0x0008U: - if (item.element == 0x0008U) - image_type = join (item.get_string(), " "); - return; - case 0x0018U: + case 0x0008U: switch (item.element) { - case 0x0050U: - slice_thickness = item.get_float()[0]; + case 0x0008U: + image_type = join (item.get_string(), " "); + return; + case 0x0032U: + acquisition_time = item.get_time(); + return; + default: + return; + } + + case 0x0018U: + switch (item.element) { + case 0x0050U: + slice_thickness = item.get_float()[0]; return; case 0x0088U: slice_spacing = item.get_float()[0]; return; - case 0x1310U: + case 0x1310U: acq_dim[0] = std::max (item.get_uint()[0], item.get_uint()[1]); acq_dim[1] = std::max (item.get_uint()[2], item.get_uint()[3]); if (item.get_uint()[0] == 0 && item.get_uint()[3] == 0) std::swap (acq_dim[0], acq_dim[1]); return; - case 0x0024U: + case 0x0024U: sequence_name = item.get_string()[0]; if (!sequence_name.size()) return; - { + { int c = sequence_name.size()-1; if (!isdigit (sequence_name[c])) return; - while (c >= 0 && isdigit (sequence_name[c])) + while (c >= 0 && isdigit (sequence_name[c])) --c; ++c; sequence = to (sequence_name.substr (c)); } return; - case 0x9087U: - bvalue = item.get_float()[0]; + case 0x9087U: + bvalue = item.get_float()[0]; return; case 0x9089U: G[0] = item.get_float()[0]; @@ -100,16 +108,16 @@ namespace MR { return; } return; - case 0x0020U: + case 0x0020U: switch (item.element) { - case 0x0011U: - series_num = item.get_uint()[0]; + case 0x0011U: + series_num = item.get_uint()[0]; return; case 0x0012U: - acq = item.get_uint()[0]; + acq = item.get_uint()[0]; return; - case 0x0013U: - instance = item.get_uint()[0]; + case 0x0013U: + instance = item.get_uint()[0]; return; case 0x0032U: position_vector[0] = item.get_float()[0]; @@ -126,7 +134,7 @@ namespace MR { orientation_x.normalize(); orientation_y.normalize(); return; - case 0x9157U: + case 0x9157U: index = item.get_uint(); if (frame_dim.size() < index.size()) frame_dim.resize (index.size()); @@ -138,28 +146,28 @@ namespace MR { return; case 0x0028U: switch (item.element) { - case 0x0010U: - dim[1] = item.get_uint()[0]; + case 0x0010U: + dim[1] = item.get_uint()[0]; return; case 0x0011U: - dim[0] = item.get_uint()[0]; + dim[0] = item.get_uint()[0]; return; case 0x0030U: pixel_size[0] = item.get_float()[0]; - pixel_size[1] = item.get_float()[1]; + pixel_size[1] = item.get_float()[1]; return; - case 0x0100U: - bits_alloc = item.get_uint()[0]; + case 0x0100U: + bits_alloc = item.get_uint()[0]; return; case 0x1052U: - scale_intercept = item.get_float()[0]; + scale_intercept = item.get_float()[0]; return; case 0x1053U: - scale_slope = item.get_float()[0]; + scale_slope = item.get_float()[0]; return; } return; - case 0xFFFEU: + case 0xFFFEU: switch (item.element) { case 0xE000U: if (item.parents.size() && @@ -170,13 +178,13 @@ namespace MR { frames.push_back (std::shared_ptr (new Frame (*this))); frame_offset += dim[0] * dim[1] * (bits_alloc/8); } - else + else in_frames = true; } return; } return; - case 0x7FE0U: + case 0x7FE0U: if (item.element == 0x0010U) { data = item.offset (item.data); data_size = item.size; @@ -195,29 +203,29 @@ namespace MR { // process more non-specific stuff here: switch (item.group) { - case 0x0008U: - if (item.element == 0x0070U) + case 0x0008U: + if (item.element == 0x0070U) manufacturer = item.get_string()[0]; return; - case 0x0019U: + case 0x0019U: switch (item.element) { // GE DW encoding info: case 0x10BBU: - if (item.get_float().size()) - G[0] = item.get_float()[0]; + if (item.get_float().size()) + G[0] = item.get_float()[0]; return; case 0x10BCU: - if (item.get_float().size()) - G[1] = item.get_float()[0]; + if (item.get_float().size()) + G[1] = item.get_float()[0]; return; case 0x10BDU: - if (item.get_float().size()) - G[2] = item.get_float()[0]; + if (item.get_float().size()) + G[2] = item.get_float()[0]; return; case 0x100CU: //Siemens private DW encoding tags: - if (item.get_float().size()) - bvalue = item.get_float()[0]; + if (item.get_float().size()) + bvalue = item.get_float()[0]; return; - case 0x100EU: + case 0x100EU: if (item.get_float().size() == 3) { G[0] = item.get_float()[0]; G[1] = item.get_float()[1]; @@ -233,30 +241,30 @@ namespace MR { } return; case 0x0029U: // Siemens CSA entry - if (item.element == 0x1010U || item.element == 0x1020U) + if (item.element == 0x1010U || item.element == 0x1020U) decode_csa (item.data, item.data + item.size); return; case 0x0043U: // GEMS_PARMS_01 block if (item.element == 0x1039U) { - if (item.get_int().size()) + if (item.get_int().size()) bvalue = item.get_int()[0]; DW_scheme_wrt_image = true; } return; - case 0x2001U: // Philips DW encoding info: - if (item.element == 0x1003) + case 0x2001U: // Philips DW encoding info: + if (item.element == 0x1003) bvalue = item.get_float()[0]; return; - case 0x2005U: // Philips DW encoding info: + case 0x2005U: // Philips DW encoding info: switch (item.element) { - case 0x10B0U: - G[0] = item.get_float()[0]; + case 0x10B0U: + G[0] = item.get_float()[0]; return; case 0x10B1U: - G[1] = item.get_float()[0]; + G[1] = item.get_float()[0]; return; case 0x10B2U: - G[2] = item.get_float()[0]; + G[2] = item.get_float()[0]; return; } return; @@ -275,7 +283,7 @@ namespace MR { Element item; item.set (filename); - while (item.read()) + while (item.read()) parse_item (item); calc_distance(); @@ -283,7 +291,7 @@ namespace MR { if (frame_offset > 0) frames.push_back (std::shared_ptr (new Frame (*this))); - for (size_t n = 0; n < frames.size(); ++n) + for (size_t n = 0; n < frames.size(); ++n) frames[n]->data = data + frames[n]->frame_offset; } @@ -300,18 +308,22 @@ namespace MR { CSAEntry entry (start, end); while (entry.parse()) { - if (strcmp ("B_value", entry.key()) == 0) + if (strcmp ("B_value", entry.key()) == 0) bvalue = entry.get_float(); - else if (strcmp ("DiffusionGradientDirection", entry.key()) == 0) + else if (strcmp ("DiffusionGradientDirection", entry.key()) == 0) entry.get_float (G); - else if (strcmp ("NumberOfImagesInMosaic", entry.key()) == 0) + else if (strcmp ("NumberOfImagesInMosaic", entry.key()) == 0) images_in_mosaic = entry.get_int(); - else if (strcmp ("SliceNormalVector", entry.key()) == 0) + else if (strcmp ("SliceNormalVector", entry.key()) == 0) entry.get_float (orientation_z); else if (strcmp ("PhaseEncodingDirectionPositive", entry.key()) == 0) pe_sign = (entry.get_int() > 0) ? 1 : -1; else if (strcmp ("BandwidthPerPixelPhaseEncode", entry.key()) == 0) bandwidth_per_pixel_phase_encode = entry.get_float(); + else if (strcmp ("MosaicRefAcqTimes", entry.key()) == 0) + entry.get_float (mosaic_slices_timing); + else if (strcmp ("TimeAfterStart", entry.key()) == 0) + time_after_start = entry.get_float(); } if (G[0] && bvalue) @@ -324,12 +336,12 @@ namespace MR { std::ostream& operator<< (std::ostream& stream, const Frame& item) { - stream << ( item.instance == UINT_MAX ? 0 : item.instance ) << "#" + stream << ( item.instance == UINT_MAX ? 0 : item.instance ) << "#" << ( item.acq == UINT_MAX ? 0 : item.acq) << ":" - << ( item.sequence == UINT_MAX ? 0 : item.sequence ) << " " + << ( item.sequence == UINT_MAX ? 0 : item.sequence ) << " " << item.dim[0] << "x" << item.dim[1] << ", " - << item.pixel_size[0] << "x" << item.pixel_size[1] << " x " - << item.slice_thickness << " (" << item.slice_spacing << ") mm, z = " << item.distance + << item.pixel_size[0] << "x" << item.pixel_size[1] << " x " + << item.slice_thickness << " (" << item.slice_spacing << ") mm, z = " << item.distance << ( item.index.size() ? ", index = " + str(item.index) : std::string() ) << ", [ " << item.position_vector[0] << " " << item.position_vector[1] << " " << item.position_vector[2] << " ] [ " << item.orientation_x[0] << " " << item.orientation_x[1] << " " << item.orientation_x[2] << " ] [ " @@ -341,7 +353,6 @@ namespace MR { } stream << " (\"" << item.filename << "\", " << item.data << ")"; - return stream; } @@ -349,15 +360,15 @@ namespace MR { std::ostream& operator<< (std::ostream& stream, const Image& item) { - stream << ( item.filename.size() ? item.filename : "file not set" ) << ":\n" - << ( item.sequence_name.size() ? item.sequence_name : "sequence not set" ) << " [" + stream << ( item.filename.size() ? item.filename : "file not set" ) << ":\n" + << ( item.sequence_name.size() ? item.sequence_name : "sequence not set" ) << " [" << (item.manufacturer.size() ? item.manufacturer : std::string("unknown manufacturer")) << "] " << (item.frames.size() > 0 ? str(item.frames.size()) + " frames with dim " + str(item.frame_dim) : std::string()); if (item.frames.size()) { for (size_t n = 0; n < item.frames.size(); ++n) stream << " " << static_cast(*item.frames[n]) << "\n"; } - else + else stream << " " << static_cast(item) << "\n"; return stream; @@ -394,11 +405,11 @@ namespace MR { const Frame& frame (**frame_it); if (frame.series_num != previous->series_num || - frame.acq != previous->acq) + frame.acq != previous->acq) update_count (2, dim, index); - else if (frame.distance != previous->distance) + else if (frame.distance != previous->distance) update_count (1, dim, index); - else + else update_count (0, dim, index); previous = &frame; @@ -423,8 +434,8 @@ namespace MR { default_type max_separation = 0.0; default_type sum_separation = 0.0; - if (nslices < 2) - return std::isfinite (frames[0]->slice_spacing) ? + if (nslices < 2) + return std::isfinite (frames[0]->slice_spacing) ? frames[0]->slice_spacing : frames[0]->slice_thickness; for (size_t n = 0; n < nslices-1; ++n) { diff --git a/core/file/dicom/image.h b/core/file/dicom/image.h index 3508048298..16e3460573 100644 --- a/core/file/dicom/image.h +++ b/core/file/dicom/image.h @@ -29,14 +29,14 @@ namespace MR { class Frame { MEMALIGN(Frame) public: - Frame () { + Frame () { acq_dim[0] = acq_dim[1] = dim[0] = dim[1] = instance = series_num = acq = sequence = UINT_MAX; position_vector[0] = position_vector[1] = position_vector[2] = NaN; orientation_x[0] = orientation_x[1] = orientation_x[2] = NaN; orientation_y[0] = orientation_y[1] = orientation_y[2] = NaN; orientation_z[0] = orientation_z[1] = orientation_z[2] = NaN; distance = NaN; - pixel_size[0] = pixel_size[1] = slice_thickness = slice_spacing = NaN; + pixel_size[0] = pixel_size[1] = slice_thickness = slice_spacing = NaN; scale_intercept = 0.0; scale_slope = 1.0; bvalue = G[0] = G[1] = G[2] = NaN; @@ -45,7 +45,7 @@ namespace MR { transfer_syntax_supported = true; pe_axis = 3; pe_sign = 0; - pixel_bandwidth = bandwidth_per_pixel_phase_encode = echo_time = NaN; + pixel_bandwidth = bandwidth_per_pixel_phase_encode = echo_time = time_after_start = NaN; echo_train_length = 0; } @@ -57,27 +57,28 @@ namespace MR { bool DW_scheme_wrt_image, transfer_syntax_supported; size_t pe_axis; int pe_sign; - default_type pixel_bandwidth, bandwidth_per_pixel_phase_encode, echo_time; + default_type pixel_bandwidth, bandwidth_per_pixel_phase_encode, echo_time, time_after_start; + Time acquisition_time; size_t echo_train_length; vector index; bool operator< (const Frame& frame) const { - if (series_num != frame.series_num) + if (series_num != frame.series_num) return series_num < frame.series_num; if (image_type != frame.image_type) return image_type < frame.image_type; - if (acq != frame.acq) + if (acq != frame.acq) return acq < frame.acq; assert (std::isfinite (distance)); assert (std::isfinite (frame.distance)); - if (distance != frame.distance) + if (distance != frame.distance) return distance < frame.distance; for (size_t n = index.size(); n--;) if (index[n] != frame.index[n]) return index[n] < frame.index[n]; - if (sequence != frame.sequence) + if (sequence != frame.sequence) return sequence < frame.sequence; - if (instance != frame.instance) + if (instance != frame.instance) return instance < frame.instance; return false; } @@ -85,13 +86,13 @@ namespace MR { void calc_distance () { - if (!std::isfinite (orientation_z[0])) + if (!std::isfinite (orientation_z[0])) orientation_z = orientation_x.cross (orientation_y); else { Eigen::Vector3 normal = orientation_x.cross (orientation_y); if (normal.dot (orientation_z) < 0.0) orientation_z = -normal; - else + else orientation_z = normal; } @@ -120,16 +121,17 @@ namespace MR { class Image : public Frame { MEMALIGN(Image) public: - Image (Series* parent = NULL) : - series (parent), + Image (Series* parent = nullptr) : + series (parent), images_in_mosaic (0), is_BE (false), in_frames (false) { } Series* series; size_t images_in_mosaic; - std::string sequence_name, manufacturer; + std::string sequence_name, manufacturer; bool is_BE, in_frames; + vector mosaic_slices_timing; vector frame_dim; vector> frames; diff --git a/core/file/dicom/mapper.cpp b/core/file/dicom/mapper.cpp index 0843ebdc51..0a86601096 100644 --- a/core/file/dicom/mapper.cpp +++ b/core/file/dicom/mapper.cpp @@ -12,6 +12,8 @@ */ +#include + #include "header.h" #include "phase_encoding.h" #include "image_io/default.h" @@ -38,7 +40,7 @@ namespace MR { sbuf += " " + format_ID (patient->ID); if (series[0]->modality.size()) sbuf += std::string (" [") + series[0]->modality + "]"; - if (series[0]->name.size()) + if (series[0]->name.size()) sbuf += std::string (" ") + series[0]->name; add_line (H.keyval()["comments"], sbuf); H.name() = sbuf; @@ -51,9 +53,9 @@ namespace MR { try { series_it->read(); } - catch (Exception& E) { + catch (Exception& E) { E.display(); - throw Exception ("error reading series " + str (series_it->number) + " of DICOM image \"" + H.name() + "\""); + throw Exception ("error reading series " + str (series_it->number) + " of DICOM image \"" + H.name() + "\""); } std::sort (series_it->begin(), series_it->end(), compare_ptr_contents()); @@ -70,12 +72,12 @@ namespace MR { // if multi-frame, loop over frames in image: if (image_it->frames.size()) { std::sort (image_it->frames.begin(), image_it->frames.end(), compare_ptr_contents()); - for (auto frame_it : image_it->frames) + for (auto frame_it : image_it->frames) if (frame_it->image_type == series_it->image_type) frames.push_back (frame_it.get()); } // otherwise add image frame: - else + else frames.push_back (image_it.get()); } } @@ -91,23 +93,23 @@ namespace MR { if (dim[0] > 1) { // switch axes so slice dim is inner-most: vector list (frames); vector::iterator it = frames.begin(); - for (size_t k = 0; k < dim[2]; ++k) - for (size_t i = 0; i < dim[0]; ++i) - for (size_t j = 0; j < dim[1]; ++j) + for (size_t k = 0; k < dim[2]; ++k) + for (size_t i = 0; i < dim[0]; ++i) + for (size_t j = 0; j < dim[1]; ++j) *(it++) = list[i+dim[0]*(j+dim[1]*k)]; } default_type slice_separation = Frame::get_slice_separation (frames, dim[1]); - if (series[0]->study->name.size()) + if (series[0]->study->name.size()) add_line (H.keyval()["comments"], std::string ("study: " + series[0]->study->name + " [ " + series[0]->image_type + " ]")); - if (patient->DOB.size()) + if (patient->DOB.size()) add_line (H.keyval()["comments"], std::string ("DOB: " + format_date (patient->DOB))); if (series[0]->date.size()) { sbuf = "DOS: " + format_date (series[0]->date); - if (series[0]->time.size()) + if (series[0]->time.size()) sbuf += " " + format_time (series[0]->time); add_line (H.keyval()["comments"], sbuf); } @@ -119,7 +121,7 @@ namespace MR { H.keyval()["EchoTime"] = str (0.001 * frame.echo_time, 6); size_t nchannels = image.frames.size() ? 1 : image.data_size / (frame.dim[0] * frame.dim[1] * (frame.bits_alloc/8)); - if (nchannels > 1) + if (nchannels > 1) INFO ("data segment is larger than expected from image dimensions - interpreting as multi-channel data"); H.ndim() = 3 + (dim[0]*dim[2]>1) + (nchannels>1); @@ -151,16 +153,16 @@ namespace MR { } - if (frame.bits_alloc == 8) + if (frame.bits_alloc == 8) H.datatype() = DataType::UInt8; else if (frame.bits_alloc == 16) { H.datatype() = DataType::UInt16; - if (image.is_BE) + if (image.is_BE) H.datatype() = DataType::UInt16 | DataType::BigEndian; - else + else H.datatype() = DataType::UInt16 | DataType::LittleEndian; } - else throw Exception ("unexpected number of allocated bits per pixel (" + str (frame.bits_alloc) + else throw Exception ("unexpected number of allocated bits per pixel (" + str (frame.bits_alloc) + ") in file \"" + H.name() + "\""); H.set_intensity_scaling (frame.scale_slope, frame.scale_intercept); @@ -201,7 +203,50 @@ namespace MR { throw Exception ("unable to load series due to inconsistent data scaling between DICOM images"); + // Slice timing may come from a few different potential sources + vector slices_timing; if (image.images_in_mosaic) { + if (image.mosaic_slices_timing.size() != image.images_in_mosaic) { + WARN ("Number of entries in mosaic slice timing (" + str(image.mosaic_slices_timing.size()) + ") does not match number of images in mosaic (" + str(image.images_in_mosaic) + "); omitting"); + } else { + DEBUG ("Taking slice timing information from CSA mosaic info"); + // CSA mosaic defines these in ms; we want them in s + for (auto f : image.mosaic_slices_timing) + slices_timing.push_back (0.001 * f); + H.keyval()["SliceTiming"] = join (slices_timing, ","); + H.keyval()["MultibandAccelerationFactor"] = str (std::count (slices_timing.begin(), slices_timing.end(), 0.0f)); + } + } else if (std::isfinite (frame.time_after_start)) { + DEBUG ("Taking slice timing information from CSA TimeAfterStart field"); + default_type min_time_after_start = std::numeric_limits::infinity(); + for (size_t n = 0; n != dim[1]; ++n) + min_time_after_start = std::min (min_time_after_start, frames[n]->time_after_start); + for (size_t n = 0; n != dim[1]; ++n) + slices_timing.push_back (frames[n]->time_after_start - min_time_after_start); + H.keyval()["SliceTiming"] = join (slices_timing, ","); + } else if (std::isfinite (frame.acquisition_time)) { + DEBUG ("Estimating slice timing from DICOM AcquisitionTime field"); + default_type min_acquisition_time = std::numeric_limits::infinity(); + for (size_t n = 0; n != dim[1]; ++n) + min_acquisition_time = std::min (min_acquisition_time, default_type(frames[n]->acquisition_time)); + for (size_t n = 0; n != dim[1]; ++n) + slices_timing.push_back (default_type(frames[n]->acquisition_time) - min_acquisition_time); + } + if (slices_timing.size()) { + const size_t slices_acquired_at_zero = std::count (slices_timing.begin(), slices_timing.end(), 0.0f); + if (slices_acquired_at_zero < (image.images_in_mosaic ? image.images_in_mosaic : dim[1])) { + H.keyval()["SliceTiming"] = join (slices_timing, ","); + H.keyval()["MultibandAccelerationFactor"] = str (slices_acquired_at_zero); + } else { + DEBUG ("All slices acquired at same time; not writing slice timing information"); + } + } else { + DEBUG ("No slice timing information obtained"); + } + + + if (image.images_in_mosaic) { + INFO ("DICOM image \"" + H.name() + "\" is in mosaic format"); if (H.size (2) != 1) throw Exception ("DICOM mosaic contains multiple slices in image \"" + H.name() + "\""); @@ -212,33 +257,35 @@ namespace MR { H.size(2) = image.images_in_mosaic; if (frame.acq_dim[0] > H.size(0) || frame.acq_dim[1] > H.size(1)) { - WARN ("acquisition matrix [ " + str (frame.acq_dim[0]) + " " + str (frame.acq_dim[1]) + WARN ("acquisition matrix [ " + str (frame.acq_dim[0]) + " " + str (frame.acq_dim[1]) + " ] is smaller than expected [ " + str(H.size(0)) + " " + str(H.size(1)) + " ] in DICOM mosaic"); WARN (" image may be incorrectly reformatted"); } if (H.size(0)*mosaic_size != frame.dim[0] || H.size(1)*mosaic_size != frame.dim[1]) { - WARN ("dimensions of DICOM mosaic [ " + str(frame.dim[0]) + " " + str(frame.dim[1]) + WARN ("dimensions of DICOM mosaic [ " + str(frame.dim[0]) + " " + str(frame.dim[1]) + " ] do not match expected size [ " + str(H.size(0)*mosaic_size) + " " + str(H.size(0)*mosaic_size) + " ]"); WARN (" assuming data are stored as " + str(mosaic_size)+"x"+str(mosaic_size) + " mosaic of " + str(H.size(0))+"x"+ str(H.size(1)) + " slices."); WARN (" image may be incorrectly reformatted"); } - if (frame.acq_dim[0] != H.size(0)|| frame.acq_dim[1] != H.size(1)) - INFO ("note: acquisition matrix [ " + str (frame.acq_dim[0]) + " " + str (frame.acq_dim[1]) + if (frame.acq_dim[0] != H.size(0)|| frame.acq_dim[1] != H.size(1)) + INFO ("note: acquisition matrix [ " + str (frame.acq_dim[0]) + " " + str (frame.acq_dim[1]) + " ] differs from reconstructed matrix [ " + str(H.size(0)) + " " + str(H.size(1)) + " ]"); float xinc = H.spacing(0) * (frame.dim[0] - H.size(0)) / 2.0; float yinc = H.spacing(1) * (frame.dim[1] - H.size(1)) / 2.0; - for (size_t i = 0; i < 3; i++) + for (size_t i = 0; i < 3; i++) H.transform()(i,3) += xinc * H.transform()(i,0) + yinc * H.transform()(i,1); io_handler.reset (new MR::ImageIO::Mosaic (H, frame.dim[0], frame.dim[1], H.size (0), H.size (1), H.size (2))); - } - else + + } else { + io_handler.reset (new MR::ImageIO::Default (H)); + } - for (size_t n = 0; n < frames.size(); ++n) + for (size_t n = 0; n < frames.size(); ++n) io_handler->files.push_back (File::Entry (frames[n]->filename, frames[n]->data)); return io_handler; diff --git a/core/mrtrix.h b/core/mrtrix.h index 70f437e307..6a05cfba2d 100644 --- a/core/mrtrix.h +++ b/core/mrtrix.h @@ -45,8 +45,8 @@ namespace MR inline std::istream& getline (std::istream& stream, std::string& string) { std::getline (stream, string); - if (string.size() > 0) - if (string[string.size()-1] == 015) + if (string.size() > 0) + if (string[string.size()-1] == 015) string.resize (string.size()-1); return stream; } @@ -97,12 +97,12 @@ namespace MR } - //! convert a long string to 'beginningofstring...endofstring' for display + //! convert a long string to 'beginningofstring...endofstring' for display inline std::string shorten (const std::string& text, size_t longest = 40, size_t prefix = 10) { if (text.size() > longest) return (text.substr (0,prefix) + "..." + text.substr (text.size()-longest+prefix+3)); - else + else return text; } @@ -163,7 +163,7 @@ namespace MR inline std::string strip (const std::string& string, const char* ws = " \t\n", bool left = true, bool right = true) { std::string::size_type start = (left ? string.find_first_not_of (ws) : 0); - if (start == std::string::npos) + if (start == std::string::npos) return ""; std::string::size_type end = (right ? string.find_last_not_of (ws) + 1 : std::string::npos); return string.substr (start, end - start); @@ -171,19 +171,19 @@ namespace MR - inline void replace (std::string& string, char orig, char final) + inline void replace (std::string& string, char orig, char final) { for (std::string::iterator i = string.begin(); i != string.end(); ++i) if (*i == orig) *i = final; } - inline void replace (std::string& str, const std::string& from, const std::string& to) + inline void replace (std::string& str, const std::string& from, const std::string& to) { if (from.empty()) return; size_t start_pos = 0; while((start_pos = str.find(from, start_pos)) != std::string::npos) { str.replace (start_pos, from.length(), to); - start_pos += to.length(); + start_pos += to.length(); } } @@ -197,7 +197,8 @@ namespace MR inline vector split_lines ( const std::string& string, bool ignore_empty_fields = true, - size_t num = std::numeric_limits::max()) { + size_t num = std::numeric_limits::max()) + { return split (string, "\n", ignore_empty_fields, num); } @@ -212,19 +213,31 @@ namespace MR return ret; } + template + inline std::string join (const vector& V, const std::string& delimiter) + { + std::string ret; + if (V.empty()) + return ret; + ret = str(V[0]); + for (typename vector::const_iterator i = V.begin() +1; i != V.end(); ++i) + ret += delimiter + str(*i); + return ret; + } + inline std::string join (const char* const* null_terminated_array, const std::string& delimiter) { std::string ret; if (!null_terminated_array) return ret; ret = null_terminated_array[0]; - for (const char* const* p = null_terminated_array+1; *p; ++p) + for (const char* const* p = null_terminated_array+1; *p; ++p) ret += delimiter + *p; return ret; } vector parse_floats (const std::string& spec); - vector parse_ints (const std::string& spec, int last = std::numeric_limits::max()); + vector parse_ints (const std::string& spec, int last = std::numeric_limits::max()); /* inline int round (default_type x) @@ -242,10 +255,10 @@ namespace MR template <> inline std::string str (const cfloat& value, int precision) { std::ostringstream stream; - if (precision > 0) + if (precision > 0) stream.precision (precision); stream << value.real(); - if (value.imag()) + if (value.imag()) stream << std::showpos << value.imag() << "i"; if (stream.fail()) throw Exception ("error converting value to string"); @@ -267,7 +280,7 @@ namespace MR return cfloat (0.0f, real); stream >> imag; - if (stream.fail()) + if (stream.fail()) return cfloat (real, 0.0f); else if (stream.peek() != 'i' && stream.peek() != 'j') throw Exception ("error converting string \"" + string + "\""); @@ -280,10 +293,10 @@ namespace MR template <> inline std::string str (const cdouble& value, int precision) { std::ostringstream stream; - if (precision > 0) + if (precision > 0) stream.precision (precision); stream << value.real(); - if (value.imag()) + if (value.imag()) stream << std::showpos << value.imag() << "i"; if (stream.fail()) throw Exception ("error converting value to string"); @@ -301,11 +314,11 @@ namespace MR if (stream.eof()) return cdouble (real, 0.0); - if (stream.peek() == 'i' || stream.peek() == 'j') + if (stream.peek() == 'i' || stream.peek() == 'j') return cdouble (0.0, real); stream >> imag; - if (stream.fail()) + if (stream.fail()) return cdouble (real, 0.0); else if (stream.peek() != 'i' && stream.peek() != 'j') throw Exception ("error converting string \"" + string + "\""); @@ -317,9 +330,9 @@ namespace MR template <> inline bool to (const std::string& string) { std::string value = lowercase (string); - if (value == "true" || value == "yes") + if (value == "true" || value == "yes") return true; - if (value == "false" || value == "no") + if (value == "false" || value == "no") return false; return to (value); } From e4a9af5c7a269c7d23ce7a49a1584191c8313b4f Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 19 Oct 2017 17:28:26 +1100 Subject: [PATCH 187/538] dwipreproc: Support eddy slice-to-volume correction If the user specifies --mporder within -eddy_options, this will be handled in one of two ways: - If the user has also specified --slspec within -eddy_options, then dwipreproc will find that file, copy it into the temporary directory, and modify the contents of -eddy_options to reflect the location of that file. If --slspec is not specified within -eddy_options, then dwipreproc will look for 'SliceTiming' within the input DWI header key-value entries. If this is found, then an appropriate slspec file is generated based on the slice timings, and this is provided to eddy. Closes #1169. --- bin/dwipreproc | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 0364c91829..2e9a6f0ac7 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -22,7 +22,7 @@ if not os.path.isdir(lib_folder): sys.exit(1) sys.path.insert(0, lib_folder) -import math +import math, itertools from mrtrix3 import app, file, fsl, image, path, phaseEncoding, run #pylint: disable=redefined-builtin @@ -147,6 +147,43 @@ if not len(grad) == num_volumes: app.error('Number of lines in gradient table (' + str(len(grad)) + ') does not match input image (' + str(num_volumes) + ' volumes); check your input data') +# Check the manual options being passed to eddy, ensure they make sense +eddy_manual_options = '' +if app.args.eddy_options: + # Initially process as a list; we'll convert back to a string later + eddy_manual_options = app.args.eddy_options.strip().split() + if '--resamp=lsr' in eddy_manual_options: + app.error('dwipreproc does not currently support least-squares reconstruction; this cannot be simply passed via -eddy_options') + if any(s.startswith('--mporder') for s in eddy_manual_options): + slspec_option = [ s for s in eddy_manual_options if s.startswith('--slspec') ] + if len(slspec_option) > 1: + app.error('--slspec option appears more than once in -eddy_options input; cannot import slice timing') + elif len(slspec_option) == 1: + slspec_file_path = path.fromUser(slspec_option[0][9:], False) + if os.path.isfile(slspec_file_path): + run.function(shutil.copy, slspec_file_path, 'slspec.txt') + eddy_manual_options = [ s for s in eddy_manual_options if not s.startswith('--slspec') ] + eddy_manual_options.append('--slspec=slspec.txt') + else: + app.error('Unable to find \'slspec\' file provided via -eddy_options \" ... --slspec=/path/to/file ... \" (expected location: ' + slspec_file_path + ')') + else: + if not 'SliceTiming' in dwi_header.keyval(): + app.error('Cannot perform slice-to-volume correction in eddy: No slspec file provided, and no slice timing information present in header') + slice_timing = dwi_header.keyval()['SliceTiming'][0] + if len(slice_timing) != dwi_header.size()[2]: + app.error('Cannot use slice timing information in image header for slice-to-volume correction: Number of entries (' + len(slice_timing) + ') does not match number of slices (' + dwi_header.size()[2] + ')') + # This list contains, for each slice, the timing offset between acquisition of the + # first slice in the volume, and acquisition of that slice + # Eddy however requires a text file where each row contains those slices that were + # acquired with a single readout, in ordered rows from first slice (group) + # acquired to last slice (group) acquired + slspec = [ [ x[0] for x in g ] for k, g in itertools.groupby(sorted(enumerate(slice_timing), key=lambda x:x[1]), key=lambda x:x[1]) ] + with open('slspec.txt', 'w') as f: + for line in slspec: + f.write(' '.join(str(value) for value in line) + '\n') + eddy_manual_options.append('--slspec=slspec.txt') + eddy_manual_options = ' ' + ' '.join(eddy_manual_options) + # Since we want to access user-defined phase encoding information regardless of whether or not # such information is present in the header, let's grab it here @@ -492,9 +529,6 @@ else: # Run eddy run.command('mrconvert dwi.mif' + import_dwi_pe_table_option + ' dwi.nii -stride -1,+2,+3,+4 -export_grad_fsl bvecs bvals -export_pe_eddy eddy_config.txt eddy_indices.txt') file.delTemporary('dwi.mif') -eddy_manual_options = '' -if app.args.eddy_options: - eddy_manual_options = ' ' + app.args.eddy_options.strip() run.command(eddy_cmd + ' --imain=dwi.nii --mask=mask.nii --acqp=eddy_config.txt --index=eddy_indices.txt --bvecs=bvecs --bvals=bvals' + eddy_in_topup_option + eddy_manual_options + ' --out=dwi_post_eddy') From 03e3b97eab3a7dab3334c627df10a3cb23866557 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 19 Oct 2017 17:53:59 +1100 Subject: [PATCH 188/538] dwipreproc: Clear vestigial key-value entries --- bin/dwipreproc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 2e9a6f0ac7..55e8d3afdc 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -178,6 +178,7 @@ if app.args.eddy_options: # acquired with a single readout, in ordered rows from first slice (group) # acquired to last slice (group) acquired slspec = [ [ x[0] for x in g ] for k, g in itertools.groupby(sorted(enumerate(slice_timing), key=lambda x:x[1]), key=lambda x:x[1]) ] + app.var(slice_timing, slspec) with open('slspec.txt', 'w') as f: for line in slspec: f.write(' '.join(str(value) for value in line) + '\n') @@ -707,6 +708,14 @@ else: +# Build a list of header key-value entries that we want to _remove_ from the +# output image, as they may have been useful for controlling pre-processing +# but are no longer required, and will just bloat the key-value listings of +# all subsequent derived images +keys_to_remove = [ 'EchoTime', 'FlipAngle', 'MultibandAccelerationFactor', 'PhaseEncodingDirection', 'RepetitionTime', 'SliceTiming', 'TotalReadoutTime', 'pe_scheme' ] +clear_property_options = ' ' + ' '.join(['-clear_property '+key for key in keys_to_remove if key in dwi_header.keyval() ]) + + # Finish! -run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + grad_export_option + (' -force' if app.forceOverwrite else '')) +run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + grad_export_option + clear_property_options + (' -force' if app.forceOverwrite else '')) app.complete() From b7a280731a1adfb67ac46168c454f0ea5fd02b18 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 20 Oct 2017 10:13:01 +1100 Subject: [PATCH 189/538] dwipreproc: References and pylint fixes --- bin/dwipreproc | 12 +++++++----- docs/reference/scripts/dwipreproc.rst | 8 ++++++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 55e8d3afdc..de1f5508fa 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -22,7 +22,7 @@ if not os.path.isdir(lib_folder): sys.exit(1) sys.path.insert(0, lib_folder) -import math, itertools +import math, itertools, shutil from mrtrix3 import app, file, fsl, image, path, phaseEncoding, run #pylint: disable=redefined-builtin @@ -33,6 +33,8 @@ app.cmdline.addCitation('', 'Andersson, J. L. & Sotiropoulos, S. N. An integrate app.cmdline.addCitation('', 'Smith, S. M.; Jenkinson, M.; Woolrich, M. W.; Beckmann, C. F.; Behrens, T. E.; Johansen-Berg, H.; Bannister, P. R.; De Luca, M.; Drobnjak, I.; Flitney, D. E.; Niazy, R. K.; Saunders, J.; Vickers, J.; Zhang, Y.; De Stefano, N.; Brady, J. M. & Matthews, P. M. Advances in functional and structural MR image analysis and implementation as FSL. NeuroImage, 2004, 23, S208-S219', True) app.cmdline.addCitation('If performing recombination of diffusion-weighted volume pairs with opposing phase encoding directions', 'Skare, S. & Bammer, R. Jacobian weighting of distortion corrected EPI data. Proceedings of the International Society for Magnetic Resonance in Medicine, 2010, 5063', True) app.cmdline.addCitation('If performing EPI susceptibility distortion correction', 'Andersson, J. L.; Skare, S. & Ashburner, J. How to correct susceptibility distortions in spin-echo echo-planar images: application to diffusion tensor imaging. NeuroImage, 2003, 20, 870-888', True) +app.cmdline.addCitation('If including "--repol" in -eddy_options input', 'Andersson, J. L. R.; Graham, M. S.; Zsoldos, E. & Sotiropoulos, S. N. Incorporating outlier detection and replacement into a non-parametric framework for movement and distortion correction of diffusion MR images. NeuroImage, 2016, 141, 556-572', True) +app.cmdline.addCitation('If including "--mporder" in -eddy_options input', 'Andersson, J. L. R.; Graham, M. S.; Drobnjak, I.; Zhang, H.; Filippini, N. & Bastiani, M. Towards a comprehensive framework for movement and distortion correction of diffusion MR images: Within volume movement. NeuroImage, 2017, 152, 450-466', True) app.cmdline.add_argument('input', help='The input DWI series to be corrected') app.cmdline.add_argument('output', help='The output corrected image series') grad_export_options = app.cmdline.add_argument_group('Options for exporting the diffusion gradient table') @@ -46,8 +48,8 @@ app.cmdline.flagMutuallyExclusiveOptions( [ 'grad', 'fslgrad' ] ) options = app.cmdline.add_argument_group('Other options for the dwipreproc script') options.add_argument('-pe_dir', metavar=('PE'), help='Manually specify the phase encoding direction of the input series; can be a signed axis number (e.g. -0, 1, +2), an axis designator (e.g. RL, PA, IS), or NIfTI axis codes (e.g. i-, j, k)') options.add_argument('-readout_time', metavar=('time'), type=float, help='Manually specify the total readout time of the input series (in seconds)') -options.add_argument('-se_epi', metavar=('file'), help='Provide an additional image series consisting of spin-echo EPI images, which is to be used exclusively by topup for estimating the inhomogeneity field (i.e. it will not form part of the output image series)') -options.add_argument('-json_import', metavar=('JSON_file'), help='Import image header information from an associated JSON file (may be necessary to determine phase encoding information)') +options.add_argument('-se_epi', metavar=('image'), help='Provide an additional image series consisting of spin-echo EPI images, which is to be used exclusively by topup for estimating the inhomogeneity field (i.e. it will not form part of the output image series)') +options.add_argument('-json_import', metavar=('file'), help='Import image header information from an associated JSON file (may be necessary to determine phase encoding information)') options.add_argument('-topup_options', metavar=('TopupOptions'), help='Manually provide additional command-line options to the topup command (provide a string within quotation marks that contains at least one space, even if only passing a single command-line option to topup)') options.add_argument('-eddy_options', metavar=('EddyOptions'), help='Manually provide additional command-line options to the eddy command (provide a string within quotation marks that contains at least one space, even if only passing a single command-line option to eddy)') options.add_argument('-cuda', help='Use the CUDA version of eddy (if available)', action='store_true', default=False) @@ -167,7 +169,7 @@ if app.args.eddy_options: else: app.error('Unable to find \'slspec\' file provided via -eddy_options \" ... --slspec=/path/to/file ... \" (expected location: ' + slspec_file_path + ')') else: - if not 'SliceTiming' in dwi_header.keyval(): + if 'SliceTiming' not in dwi_header.keyval(): app.error('Cannot perform slice-to-volume correction in eddy: No slspec file provided, and no slice timing information present in header') slice_timing = dwi_header.keyval()['SliceTiming'][0] if len(slice_timing) != dwi_header.size()[2]: @@ -177,7 +179,7 @@ if app.args.eddy_options: # Eddy however requires a text file where each row contains those slices that were # acquired with a single readout, in ordered rows from first slice (group) # acquired to last slice (group) acquired - slspec = [ [ x[0] for x in g ] for k, g in itertools.groupby(sorted(enumerate(slice_timing), key=lambda x:x[1]), key=lambda x:x[1]) ] + slspec = [ [ x[0] for x in g ] for _, g in itertools.groupby(sorted(enumerate(slice_timing), key=lambda x:x[1]), key=lambda x:x[1]) ] #pylint: disable=unused-variable app.var(slice_timing, slspec) with open('slspec.txt', 'w') as f: for line in slspec: diff --git a/docs/reference/scripts/dwipreproc.rst b/docs/reference/scripts/dwipreproc.rst index c0f1392fbc..a88002d3da 100644 --- a/docs/reference/scripts/dwipreproc.rst +++ b/docs/reference/scripts/dwipreproc.rst @@ -44,9 +44,9 @@ Other options for the dwipreproc script - **-readout_time time** Manually specify the total readout time of the input series (in seconds) -- **-se_epi file** Provide an additional image series consisting of spin-echo EPI images, which is to be used exclusively by topup for estimating the inhomogeneity field (i.e. it will not form part of the output image series) +- **-se_epi image** Provide an additional image series consisting of spin-echo EPI images, which is to be used exclusively by topup for estimating the inhomogeneity field (i.e. it will not form part of the output image series) -- **-json_import JSON_file** Import image header information from an associated JSON file (may be necessary to determine phase encoding information) +- **-json_import file** Import image header information from an associated JSON file (may be necessary to determine phase encoding information) - **-topup_options TopupOptions** Manually provide additional command-line options to the topup command (provide a string within quotation marks that contains at least one space, even if only passing a single command-line option to topup) @@ -100,6 +100,10 @@ References * If performing EPI susceptibility distortion correction: Andersson, J. L.; Skare, S. & Ashburner, J. How to correct susceptibility distortions in spin-echo echo-planar images: application to diffusion tensor imaging. NeuroImage, 2003, 20, 870-888 +* If including "--repol" in -eddy_options input: Andersson, J. L. R.; Graham, M. S.; Zsoldos, E. & Sotiropoulos, S. N. Incorporating outlier detection and replacement into a non-parametric framework for movement and distortion correction of diffusion MR images. NeuroImage, 2016, 141, 556-572 + +* If including "--mporder" in -eddy_options input: Andersson, J. L. R.; Graham, M. S.; Drobnjak, I.; Zhang, H.; Filippini, N. & Bastiani, M. Towards a comprehensive framework for movement and distortion correction of diffusion MR images: Within volume movement. NeuroImage, 2017, 152, 450-466 + -------------- From bb0db24a162e43fa60340c63f3054c4a69937251 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 20 Oct 2017 13:52:55 +1100 Subject: [PATCH 190/538] dwipreproc: New command-line options New options: -eddyqc_text and -eddyqc_all These options simply allow the user to capture some or all of the files generated by eddy for the purpose of quality control. -eddyqc_text only copies text files generated by eddy, which relate to motion and eddy current parameters, outlier detection, and shell alignment. -eddyqc_all will additionally copy images generated by eddy to a specified output directory (these may require considerable storage space, and therefore may not be desired in many use cases, hence the requirement for two separate command-line options). --- bin/dwipreproc | 42 +++++++++++++++++++++++++-- docs/reference/scripts/dwipreproc.rst | 4 +++ 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 9574246600..e731477cac 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -22,7 +22,7 @@ if not os.path.isdir(lib_folder): sys.exit(1) sys.path.insert(0, lib_folder) -import math +import math, shutil from mrtrix3 import app, file, fsl, image, path, phaseEncoding, run #pylint: disable=redefined-builtin @@ -52,6 +52,8 @@ options.add_argument('-json_import', metavar=('JSON_file'), help='Import image h options.add_argument('-topup_options', metavar=('TopupOptions'), help='Manually provide additional command-line options to the topup command (provide a string within quotation marks that contains at least one space, even if only passing a single command-line option to topup)') options.add_argument('-eddy_options', metavar=('EddyOptions'), help='Manually provide additional command-line options to the eddy command (provide a string within quotation marks that contains at least one space, even if only passing a single command-line option to eddy)') options.add_argument('-cuda', help='Use the CUDA version of eddy (if available)', action='store_true', default=False) +options.add_argument('-eddyqc_text', metavar=('directory'), help='Copy the various text-based statistical outputs generated by eddy into an output directory') +options.add_argument('-eddyqc_all', metavar=('directory'), help='Copy ALL outputs generated by eddy (including images) into an output directory') rpe_options = app.cmdline.add_argument_group('Options for specifying the acquisition phase-encoding design; note that one of the -rpe_* options MUST be provided') rpe_options.add_argument('-rpe_none', action='store_true', help='Specify that no reversed phase-encoding image data is being provided; eddy will perform eddy current and motion correction only') rpe_options.add_argument('-rpe_pair', action='store_true', help='Specify that a set of images (typically b=0 volumes) will be provided for use in inhomogeneity field estimation only (using the -se_epi option). It is assumed that the FIRST volume(s) of this image has the SAME phase-encoding direction as the input DWIs, and the LAST volume(s) has precisely the OPPOSITE phase encoding') @@ -61,6 +63,7 @@ app.cmdline.flagMutuallyExclusiveOptions( [ 'rpe_none', 'rpe_pair', 'rpe_all', ' app.cmdline.flagMutuallyExclusiveOptions( [ 'rpe_none', 'se_epi' ], False ) # May still technically provide -se_epi even with -rpe_all app.cmdline.flagMutuallyExclusiveOptions( [ 'rpe_header', 'pe_dir' ], False ) # Can't manually provide phase-encoding direction if expecting it to be in the header app.cmdline.flagMutuallyExclusiveOptions( [ 'rpe_header', 'readout_time' ], False ) # Can't manually provide readout time if expecting it to be in the header +app.cmdline.flagMutuallyExclusiveOptions( [ 'eddyqc_text', 'eddyqc_all' ], False ) app.parse() @@ -112,6 +115,30 @@ elif app.args.export_grad_fsl: app.checkOutputPath(path.fromUser(app.args.export_grad_fsl[1], False)) +eddyqc_path = None +eddyqc_files = [ 'eddy_parameters', 'eddy_movement_rms', 'eddy_restricted_movement_rms', \ + 'eddy_post_eddy_shell_alignment_parameters', 'eddy_post_eddy_shell_PE_translation_parameters', \ + 'eddy_outlier_report', 'eddy_outlier_map', 'eddy_outlier_n_stdev_map', 'eddy_outlier_n_sqr_stdev_map', \ + 'eddy_movement_over_time' ] +if app.args.eddyqc_text: + eddyqc_path = path.fromUser(app.args.eddyqc_text, False) +elif app.args.eddyqc_all: + eddyqc_path = path.fromUser(app.args.eddyqc_all, False) + eddyqc_files.extend([ 'eddy_outlier_free_data.nii.gz', 'eddy_cnr_maps.nii.gz', 'eddy_residuals.nii.gz' ]) +if eddyqc_path: + if os.path.exists(eddyqc_path): + if os.path.isdir(eddyqc_path): + if any([ os.path.exists(os.path.join(eddyqc_path, filename)) for filename in eddyqc_files ]): + if app.forceOverwrite: + app.warn('Output eddy QC directory already contains relevant files; these will be overwritten on completion') + else: + app.error('Output eddy QC directory already contains relevant files (use -force to override)') + else: + if app.forceOverwrite: + app.warn('Target for eddy QC output is not a directory; it will be overwritten on completion') + else: + app.error('Target for eddy QC output exists, and is not a directory (use -force to override)') + # Convert all input images into MRtrix format and store in temprary directory first app.makeTempDir() @@ -488,7 +515,7 @@ if app.args.se_epi: se_epi_volume_to_remove = index new_se_epi_path = os.path.splitext(se_epi_path)[0] + '_firstdwibzero.mif' if (se_epi_pe_sum == [ 0, 0, 0 ]) and (se_epi_volume_to_remove < len(se_epi_pe_scheme)): - app.console('Balanced phase-encoding scheme detected in SE-EPi series; volume ' + str(se_epi_volume_to_remove) + ' will be removed and replaced with first b=0 from DWIs') + app.console('Balanced phase-encoding scheme detected in SE-EPI series; volume ' + str(se_epi_volume_to_remove) + ' will be removed and replaced with first b=0 from DWIs') run.command('mrconvert ' + se_epi_path + ' - -coord 3 ' + ','.join([str(index) for index in range(len(se_epi_pe_scheme)) if not index == se_epi_volume_to_remove]) + ' | mrcat dwi_first_bzero.mif - ' + new_se_epi_path + ' -axis 3') # Also need to update the phase-encoding scheme appropriately if it's being set manually # (if embedded within the image headers, should be updated through the command calls) @@ -882,7 +909,16 @@ else: file.delTemporary(entry) -# Should header key-values only in place for the purposes of pre-processing (i.e. TE, TR, flip angle, in-plane acceleration) be erased? +# Grab any relevant files that eddy has created, and copy them to the requested directory +if eddyqc_path: + if os.path.exists(eddyqc_path) and not os.path.isdir(eddyqc_path): + run.function(os.remove, eddyqc_path) + if not os.path.exists(eddyqc_path): + run.function(os.makedirs, eddyqc_path) + for filename in eddyqc_files: + if os.path.exists('dwi_post_eddy.' + filename): + run.function(shutil.copy, 'dwi_post_eddy.' + filename, os.path.join(eddyqc_path, filename)) + # Finish! run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + grad_export_option + (' -force' if app.forceOverwrite else '')) diff --git a/docs/reference/scripts/dwipreproc.rst b/docs/reference/scripts/dwipreproc.rst index 485df8c468..5a07d24239 100644 --- a/docs/reference/scripts/dwipreproc.rst +++ b/docs/reference/scripts/dwipreproc.rst @@ -56,6 +56,10 @@ Other options for the dwipreproc script - **-cuda** Use the CUDA version of eddy (if available) +- **-eddyqc_text directory** Copy the various text-based statistical outputs generated by eddy into an output directory + +- **-eddyqc_all directory** Copy ALL outputs generated by eddy (including images) into an output directory + Options for importing the diffusion gradient table ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From eb447bc4b47458d20a4e4703447ed8886b517bf7 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 23 Oct 2017 15:54:45 +1100 Subject: [PATCH 191/538] Capture and use slice encoding axis information - When importing from DICOM, fill field 'SliceEncodingDirection', which is defined as part of BIDS. - Whenever MRtrix3 performs a permutation of image axes (whether implicit or explicit), additionally adjust this field, just as is performed for DW and PE schemes. - If attempting to run dwipreproc with slice-to-volume correction in eddy, ensure that if the slice encoding direction is specified, it corresponds to the third axis (which is what eddy will assume). Permutation of axes as part of dwipreproc may be addressed at a later date. --- bin/dwipreproc | 5 ++++- cmd/mrcalc.cpp | 6 ++++++ cmd/mrconvert.cpp | 14 ++++++++++++++ core/file/dicom/mapper.cpp | 5 ++--- core/file/json_utils.cpp | 25 ++++++++++++++++++------- core/header.cpp | 18 +++++++++++++++--- core/phase_encoding.cpp | 38 ++------------------------------------ core/phase_encoding.h | 12 ++++-------- 8 files changed, 65 insertions(+), 58 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index de1f5508fa..6c77103f3e 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -147,6 +147,9 @@ if 'dw_scheme' not in dwi_header.keyval(): grad = dwi_header.keyval()['dw_scheme'] if not len(grad) == num_volumes: app.error('Number of lines in gradient table (' + str(len(grad)) + ') does not match input image (' + str(num_volumes) + ' volumes); check your input data') +if if any(s.startswith('--mporder') for s in eddy_manual_options) and 'SliceEncodingDirection' in dwi_header.keyval(): + if dwi_header.keyval()['SliceEncodingDirection'] != 'k': + app.error('DWI header indicates that 3rd spatial axis is not the slice axis; this is not yet compatible with --mporder option in eddy') # Check the manual options being passed to eddy, ensure they make sense @@ -714,7 +717,7 @@ else: # output image, as they may have been useful for controlling pre-processing # but are no longer required, and will just bloat the key-value listings of # all subsequent derived images -keys_to_remove = [ 'EchoTime', 'FlipAngle', 'MultibandAccelerationFactor', 'PhaseEncodingDirection', 'RepetitionTime', 'SliceTiming', 'TotalReadoutTime', 'pe_scheme' ] +keys_to_remove = [ 'EchoTime', 'FlipAngle', 'MultibandAccelerationFactor', 'PhaseEncodingDirection', 'RepetitionTime', 'SliceEncodingDirection', 'SliceTiming', 'TotalReadoutTime', 'pe_scheme' ] clear_property_options = ' ' + ' '.join(['-clear_property '+key for key in keys_to_remove if key in dwi_header.keyval() ]) diff --git a/cmd/mrcalc.cpp b/cmd/mrcalc.cpp index 50470efa6f..dc6a89c50f 100644 --- a/cmd/mrcalc.cpp +++ b/cmd/mrcalc.cpp @@ -611,6 +611,12 @@ void get_header (const StackEntry& entry, Header& header) PhaseEncoding::clear_scheme (header); } } + + auto slice_encoding_it = entry.image->keyval().find ("SliceEncodingDirection"); + if (slice_encoding_it != entry.image->keyval().end()) { + if (header.keyval()["SliceEncodingDirection"] != slice_encoding_it->second) + header.keyval().erase (header.keyval().find ("SliceEncodingDirection")); + } } diff --git a/cmd/mrconvert.cpp b/cmd/mrconvert.cpp index 5b0f602fb6..80f49bc0f9 100644 --- a/cmd/mrconvert.cpp +++ b/cmd/mrconvert.cpp @@ -12,6 +12,7 @@ */ +#include "axes.h" #include "command.h" #include "header.h" #include "image.h" @@ -208,6 +209,18 @@ void permute_PE_scheme (Header& H, const vector& axes) +void permute_slice_direction (Header& H, const vector& axes) +{ + auto it = H.keyval().find ("SliceEncodingDirection"); + if (it == H.keyval().end()) + return; + const Eigen::Vector3 orig_dir = Axes::id2dir (it->second); + const Eigen::Vector3 new_dir (orig_dir[axes[0]], orig_dir[axes[1]], orig_dir[axes[2]]); + it->second = Axes::dir2id (new_dir); +} + + + template inline vector set_header (Header& header, const ImageType& input) @@ -233,6 +246,7 @@ inline vector set_header (Header& header, const ImageType& input) } permute_DW_scheme (header, axes); permute_PE_scheme (header, axes); + permute_slice_direction (header, axes); } else { header.ndim() = input.ndim(); axes.assign (input.ndim(), 0); diff --git a/core/file/dicom/mapper.cpp b/core/file/dicom/mapper.cpp index 0a86601096..b169fda0b8 100644 --- a/core/file/dicom/mapper.cpp +++ b/core/file/dicom/mapper.cpp @@ -213,8 +213,6 @@ namespace MR { // CSA mosaic defines these in ms; we want them in s for (auto f : image.mosaic_slices_timing) slices_timing.push_back (0.001 * f); - H.keyval()["SliceTiming"] = join (slices_timing, ","); - H.keyval()["MultibandAccelerationFactor"] = str (std::count (slices_timing.begin(), slices_timing.end(), 0.0f)); } } else if (std::isfinite (frame.time_after_start)) { DEBUG ("Taking slice timing information from CSA TimeAfterStart field"); @@ -237,8 +235,9 @@ namespace MR { if (slices_acquired_at_zero < (image.images_in_mosaic ? image.images_in_mosaic : dim[1])) { H.keyval()["SliceTiming"] = join (slices_timing, ","); H.keyval()["MultibandAccelerationFactor"] = str (slices_acquired_at_zero); + H.keyval()["SliceEncodingDirection"] = "k"; } else { - DEBUG ("All slices acquired at same time; not writing slice timing information"); + DEBUG ("All slices acquired at same time; not writing slice encoding information"); } } else { DEBUG ("No slice timing information obtained"); diff --git a/core/file/json_utils.cpp b/core/file/json_utils.cpp index 756ddd87db..30a631d277 100644 --- a/core/file/json_utils.cpp +++ b/core/file/json_utils.cpp @@ -17,6 +17,7 @@ #include "file/json_utils.h" #include "file/nifti_utils.h" +#include "axes.h" #include "exception.h" #include "header.h" #include "mrtrix.h" @@ -88,6 +89,13 @@ namespace MR PhaseEncoding::set_scheme (H, pe_scheme); INFO ("Phase encoding information read from JSON file modified according to expected header transform realignment"); } + auto slice_encoding_it = H.keyval().find ("SliceEncodingDirection"); + if (slice_encoding_it != H.keyval().end() && (order[0] != 0 || order[1] != 1 || order[2] != 2)) { + const Eigen::Vector3 orig_dir (Axes::id2dir (slice_encoding_it->second)); + const Eigen::Vector3 new_dir (orig_dir[order[0]], orig_dir[order[1]], orig_dir[order[2]]); + slice_encoding_it->second = Axes::dir2id (new_dir); + INFO ("Slice encoding direction read from JSON file modified according to expected header transform realignment"); + } } @@ -98,6 +106,7 @@ namespace MR auto pe_scheme = PhaseEncoding::get_scheme (H); vector order; File::NIfTI::adjust_transform (H, order); + Header H_adj (H); if (pe_scheme.rows() && (order[0] != 0 || order[1] != 1 || order[2] != 2 || H.stride(0) < 0 || H.stride(1) < 0 || H.stride(2) < 0)) { // Assume that image being written to disk is going to have its transform adjusted, // so modify the phase encoding scheme appropriately before writing to JSON @@ -107,16 +116,18 @@ namespace MR new_line[axis] = H.stride (order[axis]) > 0 ? pe_scheme(row, order[axis]) : -pe_scheme(row, order[axis]); pe_scheme.row (row) = new_line; } - Header H_adj (H); PhaseEncoding::set_scheme (H_adj, pe_scheme); - for (const auto& kv : H_adj.keyval()) - json[kv.first] = kv.second; INFO ("Phase encoding information written to JSON file modified according to expected header transform realignment"); - } else { - // Straight copy - for (const auto& kv : H.keyval()) - json[kv.first] = kv.second; } + auto slice_encoding_it = H_adj.keyval().find ("SliceEncodingDirection"); + if (slice_encoding_it != H_adj.keyval().end() && (order[0] != 0 || order[1] != 1 || order[2] != 2)) { + const Eigen::Vector3 orig_dir (Axes::id2dir (slice_encoding_it->second)); + const Eigen::Vector3 new_dir (orig_dir[order[0]], orig_dir[order[1]], orig_dir[order[2]]); + slice_encoding_it->second = Axes::dir2id (new_dir); + INFO ("Slice encoding direction written to JSON file modified according to expected header transform realignment"); + } + for (const auto& kv : H_adj.keyval()) + json[kv.first] = kv.second; File::OFStream out (path); out << json.dump(4); } diff --git a/core/header.cpp b/core/header.cpp index c1efbdcdc1..c9d84d3f10 100644 --- a/core/header.cpp +++ b/core/header.cpp @@ -12,8 +12,9 @@ */ -#include "mrtrix.h" +#include "axes.h" #include "header.h" +#include "mrtrix.h" #include "phase_encoding.h" #include "stride.h" #include "transform.h" @@ -69,7 +70,7 @@ namespace MR namespace { - std::string short_description (const Header& H) + std::string short_description (const Header& H) { vector dims; for (size_t n = 0; n < H.ndim(); ++n) @@ -303,7 +304,7 @@ namespace MR if (new_datatype != previous_datatype) { new_datatype.unset_flag (DataType::BigEndian); new_datatype.unset_flag (DataType::LittleEndian); - if (new_datatype != previous_datatype) + if (new_datatype != previous_datatype) WARN (std::string ("requested datatype (") + previous_datatype.specifier() + ") not supported - substituting with " + H.datatype().specifier()); } @@ -576,6 +577,17 @@ namespace MR PhaseEncoding::set_scheme (*this, pe_scheme); INFO ("Phase encoding scheme has been modified according to internal header transform realignment"); } + + // If there's any slice encoding direction information present in the + // header, that's also necessary to update here + auto slice_encoding_it = keyval().find ("SliceEncodingDirection"); + if (slice_encoding_it != keyval().end()) { + const Eigen::Vector3 orig_dir (Axes::id2dir (slice_encoding_it->second)); + const Eigen::Vector3 new_dir (orig_dir[perm[0]], orig_dir[perm[1]], orig_dir[perm[2]]); + slice_encoding_it->second = Axes::dir2id (new_dir); + INFO ("Slice encoding direction has been modified according to internal header transform realignment"); + } + } diff --git a/core/phase_encoding.cpp b/core/phase_encoding.cpp index 7fb99802b4..877caf15bb 100644 --- a/core/phase_encoding.cpp +++ b/core/phase_encoding.cpp @@ -45,41 +45,7 @@ namespace MR - std::string dir2id (const Eigen::Vector3& axis) - { - if (axis[0] == -1) { - assert (!axis[1]); assert (!axis[2]); return "i-"; - } else if (axis[0] == 1) { - assert (!axis[1]); assert (!axis[2]); return "i"; - } else if (axis[1] == -1) { - assert (!axis[0]); assert (!axis[2]); return "j-"; - } else if (axis[1] == 1) { - assert (!axis[0]); assert (!axis[2]); return "j"; - } else if (axis[2] == -1) { - assert (!axis[0]); assert (!axis[1]); return "k-"; - } else if (axis[2] == 1) { - assert (!axis[0]); assert (!axis[1]); return "k"; - } else { - throw Exception ("Malformed phase-encode direction: \"" + str(axis.transpose()) + "\""); - } - } - Eigen::Vector3 id2dir (const std::string& id) - { - if (id == "i-") - return { -1, 0, 0 }; - else if (id == "i") - return { 1, 0, 0 }; - else if (id == "j-") - return { 0, -1, 0 }; - else if (id == "j") - return { 0, 1, 0 }; - else if (id == "k-") - return { 0, 0, -1 }; - else if (id == "k") - return { 0, 0, 1 }; - else - throw Exception ("Malformed phase-encode identifier: \"" + id + "\""); - } + @@ -111,7 +77,7 @@ namespace MR const auto it_time = header.keyval().find ("TotalReadoutTime"); if (it_dir != header.keyval().end() && it_time != header.keyval().end()) { Eigen::Matrix row; - row.head<3>() = id2dir (it_dir->second); + row.head<3>() = Axes::id2dir (it_dir->second); row[3] = to(it_time->second); PE.resize ((header.ndim() > 3) ? header.size(3) : 1, 4); PE.rowwise() = row.transpose(); diff --git a/core/phase_encoding.h b/core/phase_encoding.h index 0c27b93389..cd19776665 100644 --- a/core/phase_encoding.h +++ b/core/phase_encoding.h @@ -19,10 +19,12 @@ #include #include "app.h" +#include "axes.h" #include "header.h" #include "file/ofstream.h" + namespace MR { namespace PhaseEncoding @@ -68,13 +70,7 @@ namespace MR - //! convert phase encoding direction between formats - /*! these helper functions convert the definition of - * phase-encoding direction between a 3-vector (e.g. - * [0 1 0] ) and a NIfTI axis identifier (e.g. 'i-') - */ - std::string dir2id (const Eigen::Vector3&); - Eigen::Vector3 id2dir (const std::string&); + @@ -118,7 +114,7 @@ namespace MR } else { erase ("pe_scheme"); const Eigen::Vector3 dir { PE(0, 0), PE(0, 1), PE(0, 2) }; - header.keyval()["PhaseEncodingDirection"] = dir2id (dir); + header.keyval()["PhaseEncodingDirection"] = Axes::dir2id (dir); if (PE.cols() >= 4) header.keyval()["TotalReadoutTime"] = str(PE(0, 3), 3); else From a974e5cb88fcf3042271b9cf08c6fd8b9280a5a3 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Mon, 23 Oct 2017 17:43:59 +1100 Subject: [PATCH 192/538] File core/axes.* missing from commit eb447bc4 --- core/axes.cpp | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++ core/axes.h | 47 ++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 core/axes.cpp create mode 100644 core/axes.h diff --git a/core/axes.cpp b/core/axes.cpp new file mode 100644 index 0000000000..939a5616a1 --- /dev/null +++ b/core/axes.cpp @@ -0,0 +1,71 @@ +/* Copyright (c) 2008-2017 the MRtrix3 contributors. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * + * MRtrix is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * For more details, see http://www.mrtrix.org/. + */ + + +#include "axes.h" + +#include "exception.h" +#include "mrtrix.h" + + +namespace MR +{ + namespace Axes + { + + + + std::string dir2id (const Eigen::Vector3& axis) + { + if (axis[0] == -1) { + assert (!axis[1]); assert (!axis[2]); return "i-"; + } else if (axis[0] == 1) { + assert (!axis[1]); assert (!axis[2]); return "i"; + } else if (axis[1] == -1) { + assert (!axis[0]); assert (!axis[2]); return "j-"; + } else if (axis[1] == 1) { + assert (!axis[0]); assert (!axis[2]); return "j"; + } else if (axis[2] == -1) { + assert (!axis[0]); assert (!axis[1]); return "k-"; + } else if (axis[2] == 1) { + assert (!axis[0]); assert (!axis[1]); return "k"; + } else { + throw Exception ("Malformed axis direction: \"" + str(axis.transpose()) + "\""); + } + } + + + + Eigen::Vector3 id2dir (const std::string& id) + { + if (id == "i-") + return { -1, 0, 0 }; + else if (id == "i") + return { 1, 0, 0 }; + else if (id == "j-") + return { 0, -1, 0 }; + else if (id == "j") + return { 0, 1, 0 }; + else if (id == "k-") + return { 0, 0, -1 }; + else if (id == "k") + return { 0, 0, 1 }; + else + throw Exception ("Malformed image axis identifier: \"" + id + "\""); + } + + + + + } +} diff --git a/core/axes.h b/core/axes.h new file mode 100644 index 0000000000..4081c26a62 --- /dev/null +++ b/core/axes.h @@ -0,0 +1,47 @@ +/* Copyright (c) 2008-2017 the MRtrix3 contributors. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * + * MRtrix is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * For more details, see http://www.mrtrix.org/. + */ + + +#ifndef __axes_h__ +#define __axes_h__ + + +#include + +#include "types.h" + + + +namespace MR +{ + namespace Axes + { + + + + //! convert axis directions between formats + /*! these helper functions convert the definition of + * phase-encoding direction between a 3-vector (e.g. + * [0 1 0] ) and a NIfTI axis identifier (e.g. 'i-') + */ + std::string dir2id (const Eigen::Vector3&); + Eigen::Vector3 id2dir (const std::string&); + + + + + } +} + +#endif + From 909ccab81b659cfb42eac08e1bf1cd814836f98c Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 24 Oct 2017 11:55:19 +1100 Subject: [PATCH 193/538] More work on use of slice encoding direction information - dwipreproc: If slice encoding direction is negative, then the information contained in SliceTiming needs to be reversed. - mrdegibbs: If SliceEncodingDirection is defined in the image header, use that information as appropriate: If the user has not manually specified the within-slice axes, make use of this header information, issuing a terminal message as appropriate; if user provides -axes option, compare to header information and issue warning if they are not consistent. - Better handling of slice encoding direction in backend. This parameter is in fact permitted to indicate a negative direction (as can be done with PhaseEncodingDirection), and hence axis flips need to be taken into account. Closes #1173. --- bin/dwipreproc | 12 ++++-- cmd/mrdegibbs.cpp | 86 ++++++++++++++++++++++++++++------------ core/file/json_utils.cpp | 18 ++++++--- core/header.cpp | 4 +- 4 files changed, 84 insertions(+), 36 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 6c77103f3e..650aac03cc 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -147,9 +147,13 @@ if 'dw_scheme' not in dwi_header.keyval(): grad = dwi_header.keyval()['dw_scheme'] if not len(grad) == num_volumes: app.error('Number of lines in gradient table (' + str(len(grad)) + ') does not match input image (' + str(num_volumes) + ' volumes); check your input data') -if if any(s.startswith('--mporder') for s in eddy_manual_options) and 'SliceEncodingDirection' in dwi_header.keyval(): - if dwi_header.keyval()['SliceEncodingDirection'] != 'k': - app.error('DWI header indicates that 3rd spatial axis is not the slice axis; this is not yet compatible with --mporder option in eddy') +if if any(s.startswith('--mporder') for s in eddy_manual_options): + slice_encoding_direction = '' + if 'SliceEncodingDirection' in dwi_header.keyval(): + slice_encoding_direction = dwi_header.keyval()['SliceEncodingDirection'] + app.var(slice_encoding_direction) + if not slice_encoding_direction.startswith('k'): + app.error('DWI header indicates that 3rd spatial axis is not the slice axis; this is not yet compatible with --mporder option in eddy, nor supported in dwipreproc') # Check the manual options being passed to eddy, ensure they make sense @@ -182,6 +186,8 @@ if app.args.eddy_options: # Eddy however requires a text file where each row contains those slices that were # acquired with a single readout, in ordered rows from first slice (group) # acquired to last slice (group) acquired + if '-' in slice_encoding_direction: + slice_timing = reversed(slice_timing) slspec = [ [ x[0] for x in g ] for _, g in itertools.groupby(sorted(enumerate(slice_timing), key=lambda x:x[1]), key=lambda x:x[1]) ] #pylint: disable=unused-variable app.var(slice_timing, slspec) with open('slspec.txt', 'w') as f: diff --git a/cmd/mrdegibbs.cpp b/cmd/mrdegibbs.cpp index 17a9d9c880..0326b206dc 100644 --- a/cmd/mrdegibbs.cpp +++ b/cmd/mrdegibbs.cpp @@ -14,9 +14,10 @@ #include +#include "axes.h" #include "command.h" -#include "progressbar.h" #include "image.h" +#include "progressbar.h" #include "algo/threaded_loop.h" #include @@ -29,16 +30,16 @@ void usage () SYNOPSIS = "Remove Gibbs Ringing Artifacts"; - DESCRIPTION + DESCRIPTION + "This application attempts to remove Gibbs ringing artefacts from MRI images using the method " "of local subvoxel-shifts proposed by Kellner et al. (see reference below for details)." - + + "This command is designed to run on data directly after it has been reconstructed by the scanner, " "before any interpolation of any kind has taken place. You should not run this command after any " "form of motion correction (e.g. not after dwipreproc). Similarly, if you intend running dwidenoise, " "you should run this command afterwards, since it has the potential to alter the noise structure, " "which would impact on dwidenoise's performance." - + + "Note that this method is designed to work on images acquired with full k-space coverage. " "Running this method on partial Fourier ('half-scan') data may lead to suboptimal and/or biased " "results, as noted in the original reference below. There is currently no means of dealing with this; " @@ -90,24 +91,24 @@ class ComputeSlice nsh (nsh), minW (minW), maxW (maxW), - in (in), + in (in), out (out), im1 (in.size(slice_axes[0]), in.size(slice_axes[1])), - im2 (im1.rows(), im1.cols()) { + im2 (im1.rows(), im1.cols()) { prealloc_FFT(); } - + ComputeSlice (const ComputeSlice& other) : outer_axes (other.outer_axes), slice_axes (other.slice_axes), nsh (other.nsh), minW (other.minW), maxW (other.maxW), - in (other.in), + in (other.in), out (other.out), fft (), im1 (in.size(slice_axes[0]), in.size(slice_axes[1])), - im2 (im1.rows(), im1.cols()) { + im2 (im1.rows(), im1.cols()) { prealloc_FFT(); } @@ -118,26 +119,26 @@ class ComputeSlice const int Y = slice_axes[1]; assign_pos_of (pos, outer_axes).to (in, out); - for (auto l = Loop (slice_axes) (in); l; ++l) + for (auto l = Loop (slice_axes) (in); l; ++l) im1 (in.index(X), in.index(Y)) = cdouble (in.value(), 0.0); - + unring_2d (); for (auto l = Loop (slice_axes) (out); l; ++l) - out.value() = im1 (out.index(X), out.index(Y)).real(); + out.value() = im1 (out.index(X), out.index(Y)).real(); } private: const vector& outer_axes; const vector& slice_axes; const int nsh, minW, maxW; - Image in, out; + Image in, out; Eigen::FFT fft; Eigen::MatrixXcd im1, im2, shifted; Eigen::VectorXcd v; void prealloc_FFT () { - // needed to avoid within-thread allocations, + // needed to avoid within-thread allocations, // which aren't thread-safe in FFTW: #ifdef EIGEN_FFTW_DEFAULT Eigen::VectorXcd tmp (im1.rows()); @@ -151,11 +152,11 @@ class ComputeSlice template FORCE_INLINE void FFT (Eigen::MatrixBase&& vec) { fft.fwd (v, vec); vec = v; } template FORCE_INLINE void FFT (Eigen::MatrixBase& vec) { FFT (std::move (vec)); } - template FORCE_INLINE void iFFT (Eigen::MatrixBase&& vec) { fft.inv (v, vec); vec = v; } + template FORCE_INLINE void iFFT (Eigen::MatrixBase&& vec) { fft.inv (v, vec); vec = v; } template FORCE_INLINE void iFFT (Eigen::MatrixBase& vec) { iFFT (std::move (vec)); } - template FORCE_INLINE void row_FFT (Eigen::MatrixBase& mat) { for (auto n = 0; n < mat.rows(); ++n) FFT (mat.row(n)); } + template FORCE_INLINE void row_FFT (Eigen::MatrixBase& mat) { for (auto n = 0; n < mat.rows(); ++n) FFT (mat.row(n)); } template FORCE_INLINE void row_iFFT (Eigen::MatrixBase& mat) { for (auto n = 0; n < mat.rows(); ++n) iFFT (mat.row(n)); } - template FORCE_INLINE void col_FFT (Eigen::MatrixBase& mat) { for (auto n = 0; n < mat.cols(); ++n) FFT (mat.col(n)); } + template FORCE_INLINE void col_FFT (Eigen::MatrixBase& mat) { for (auto n = 0; n < mat.cols(); ++n) FFT (mat.col(n)); } template FORCE_INLINE void col_iFFT (Eigen::MatrixBase& mat) { for (auto n = 0; n < mat.cols(); ++n) iFFT (mat.col(n)); } @@ -174,7 +175,7 @@ class ComputeSlice im2(j,k) = im1(j,k) * cj / (ck+cj); im1(j,k) *= ck / (ck+cj); } - else + else im1(j,k) = im2(j,k) = cdouble(0.0, 0.0); } } @@ -192,7 +193,7 @@ class ComputeSlice - template + template FORCE_INLINE void unring_1d (Eigen::MatrixBase&& eig) { const int n = eig.rows(); @@ -220,7 +221,7 @@ class ComputeSlice cdouble e (1.0, 0.0); shifted(0,j) = shifted(0,0); - if (!(n&1)) + if (!(n&1)) shifted(n/2,j) = cdouble(0.0, 0.0); for (int l = 0; l < maxn; l++) { @@ -237,7 +238,7 @@ class ComputeSlice TV1arr[j] = 0.0; TV2arr[j] = 0.0; for (int t = minW; t <= maxW; t++) { - TV1arr[j] += std::abs (shifted((n-t)%n,j).real() - shifted((n-t-1)%n,j).real()); + TV1arr[j] += std::abs (shifted((n-t)%n,j).real() - shifted((n-t-1)%n,j).real()); TV1arr[j] += std::abs (shifted((n-t)%n,j).imag() - shifted((n-t-1)%n,j).imag()); TV2arr[j] += std::abs (shifted((n+t)%n,j).real() - shifted((n+t+1)%n,j).real()); TV2arr[j] += std::abs (shifted((n+t)%n,j).imag() - shifted((n+t+1)%n,j).imag()); @@ -277,15 +278,15 @@ class ComputeSlice double a2i = shifted((l+1+n)%n,minidx).imag(); double s = double(shifts[minidx])/(2.0*nsh); - if (s > 0.0) + if (s > 0.0) eig(l,k) = cdouble (a1r*(1.0-s) + a0r*s, a1i*(1.0-s) + a0i*s); - else + else eig(l,k) = cdouble (a1r*(1.0+s) - a2r*s, a1i*(1.0+s) - a2i*s); } } } - template + template FORCE_INLINE void unring_1d (Eigen::MatrixBase& eig) { unring_1d (std::move (eig)); } }; @@ -302,7 +303,7 @@ void run () const int minW = App::get_option_value ("minW", 1); const int maxW = App::get_option_value ("maxW", 3); - if (minW >= maxW) + if (minW >= maxW) throw Exception ("minW must be smaller than maxW"); auto in = Image::open (argument[0]); @@ -313,13 +314,46 @@ void run () vector slice_axes = { 0, 1 }; auto opt = get_options ("axes"); + const bool axes_set_manually = opt.size(); if (opt.size()) { vector axes = opt[0][0]; - if (slice_axes.size() != 2) + if (slice_axes.size() != 2) throw Exception ("slice axes must be specified as a comma-separated 2-vector"); slice_axes = { size_t(axes[0]), size_t(axes[1]) }; } + auto slice_encoding_it = header.keyval().find ("SliceEncodingDirection"); + if (slice_encoding_it != header.keyval().end()) { + try { + const Eigen::Vector3 slice_endocing_axis_onehot = Axes::id2dir (slice_encoding_it->second); + vector auto_slice_axes = { 0, 0 }; + if (slice_endocing_axis_onehot[0]) + auto_slice_axes = { 1, 2 }; + else if (slice_endocing_axis_onehot[1]) + auto_slice_axes = { 0, 2 }; + else if (slice_endocing_axis_onehot[2]) + auto_slice_axes = { 0, 1 }; + else + throw Exception ("Fatal error: Invalid slice axis one-hot encoding [ " + str(slice_endocing_axis_onehot.transpose()) + " ]"); + if (axes_set_manually) { + if (slice_axes == auto_slice_axes) { + INFO ("User's manual selection of within-slice axes consistent with \"SliceEncodingDirection\" field in image header"); + } else { + WARN ("Within-slice axes set using -axes option will be used, but is inconsistent with SliceEncodingDirection field present in image header (" + slice_encoding_it->second + ")"); + } + } else { + if (slice_axes == auto_slice_axes) { + INFO ("\"SliceEncodingDirection\" field in image header is consistent with default selection of first two axes as being within-slice"); + } else { + slice_axes = auto_slice_axes; + CONSOLE ("Using axes { " + str(slice_axes[0]) + ", " + str(slice_axes[1]) + " } for Gibbs ringing removal based on \"SliceEncodingDirection\" field in image header"); + } + } + } catch (...) { + WARN ("Invalid value for field \"SliceEncodingDirection\" in image header (" + slice_encoding_it->second + "); ignoring"); + } + } + // build vector of outer axes: vector outer_axes (header.ndim()); std::iota (outer_axes.begin(), outer_axes.end(), 0); diff --git a/core/file/json_utils.cpp b/core/file/json_utils.cpp index 30a631d277..3880ca53c2 100644 --- a/core/file/json_utils.cpp +++ b/core/file/json_utils.cpp @@ -76,7 +76,8 @@ namespace MR auto pe_scheme = PhaseEncoding::get_scheme (H); vector order; File::NIfTI::adjust_transform (H, order); - if (pe_scheme.rows() && (order[0] != 0 || order[1] != 1 || order[2] != 2 || H.stride(0) < 0 || H.stride(1) < 0 || H.stride(2) < 0)) { + const bool axes_adjusted = (order[0] != 0 || order[1] != 1 || order[2] != 2 || H.stride(0) < 0 || H.stride(1) < 0 || H.stride(2) < 0); + if (pe_scheme.rows() && axes_adjusted) { // The corresponding header may have been rotated on image load prior to the JSON // being loaded. If this is the case, the phase encoding scheme will need to be // correspondingly rotated on import. @@ -90,9 +91,11 @@ namespace MR INFO ("Phase encoding information read from JSON file modified according to expected header transform realignment"); } auto slice_encoding_it = H.keyval().find ("SliceEncodingDirection"); - if (slice_encoding_it != H.keyval().end() && (order[0] != 0 || order[1] != 1 || order[2] != 2)) { + if (slice_encoding_it != H.keyval().end() && axes_adjusted) { const Eigen::Vector3 orig_dir (Axes::id2dir (slice_encoding_it->second)); - const Eigen::Vector3 new_dir (orig_dir[order[0]], orig_dir[order[1]], orig_dir[order[2]]); + Eigen::Vector3 new_dir; + for (size_t axis = 0; axis != 3; ++axis) + new_dir[order[axis]] = H.stride (order[axis]) > 0 ? orig_dir[order[axis]] : -orig_dir[order[axis]]; slice_encoding_it->second = Axes::dir2id (new_dir); INFO ("Slice encoding direction read from JSON file modified according to expected header transform realignment"); } @@ -107,7 +110,8 @@ namespace MR vector order; File::NIfTI::adjust_transform (H, order); Header H_adj (H); - if (pe_scheme.rows() && (order[0] != 0 || order[1] != 1 || order[2] != 2 || H.stride(0) < 0 || H.stride(1) < 0 || H.stride(2) < 0)) { + const bool axes_adjusted = (order[0] != 0 || order[1] != 1 || order[2] != 2 || H.stride(0) < 0 || H.stride(1) < 0 || H.stride(2) < 0); + if (pe_scheme.rows() && axes_adjusted) { // Assume that image being written to disk is going to have its transform adjusted, // so modify the phase encoding scheme appropriately before writing to JSON for (ssize_t row = 0; row != pe_scheme.rows(); ++row) { @@ -120,9 +124,11 @@ namespace MR INFO ("Phase encoding information written to JSON file modified according to expected header transform realignment"); } auto slice_encoding_it = H_adj.keyval().find ("SliceEncodingDirection"); - if (slice_encoding_it != H_adj.keyval().end() && (order[0] != 0 || order[1] != 1 || order[2] != 2)) { + if (slice_encoding_it != H_adj.keyval().end() && axes_adjusted) { const Eigen::Vector3 orig_dir (Axes::id2dir (slice_encoding_it->second)); - const Eigen::Vector3 new_dir (orig_dir[order[0]], orig_dir[order[1]], orig_dir[order[2]]); + Eigen::Vector3 new_dir; + for (size_t axis = 0; axis != 3; ++axis) + new_dir[order[axis]] = H.stride (order[axis]) > 0 ? orig_dir[order[axis]] : -orig_dir[order[axis]]; slice_encoding_it->second = Axes::dir2id (new_dir); INFO ("Slice encoding direction written to JSON file modified according to expected header transform realignment"); } diff --git a/core/header.cpp b/core/header.cpp index c9d84d3f10..e73eab1580 100644 --- a/core/header.cpp +++ b/core/header.cpp @@ -583,7 +583,9 @@ namespace MR auto slice_encoding_it = keyval().find ("SliceEncodingDirection"); if (slice_encoding_it != keyval().end()) { const Eigen::Vector3 orig_dir (Axes::id2dir (slice_encoding_it->second)); - const Eigen::Vector3 new_dir (orig_dir[perm[0]], orig_dir[perm[1]], orig_dir[perm[2]]); + Eigen::Vector3 new_dir; + for (size_t axis = 0; axis != 3; ++axis) + new_dir[axis] = orig_dir[perm[axis]] * (flip[axis] ? -1.0 : 1.0); slice_encoding_it->second = Axes::dir2id (new_dir); INFO ("Slice encoding direction has been modified according to internal header transform realignment"); } From 2fc4188666ce7ee7b8cc87917b077d9e775ec87a Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 24 Oct 2017 14:25:05 +1100 Subject: [PATCH 194/538] dwipreproc: Fix issues arising from merge Combining changes related to -se_epi option, and those for compatibility with -eddy_options "--mporder", resulted in a couple of little mistakes. --- bin/dwipreproc | 81 +++++++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 38 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 8dd7f9bda2..5bcd37d05e 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -114,6 +114,12 @@ elif app.args.export_grad_fsl: app.checkOutputPath(path.fromUser(app.args.export_grad_fsl[1], False)) +eddy_manual_options = '' +if app.args.eddy_options: + # Initially process as a list; we'll convert back to a string later + eddy_manual_options = app.args.eddy_options.strip().split() + + # Convert all input images into MRtrix format and store in temprary directory first app.makeTempDir() @@ -150,7 +156,7 @@ if app.args.se_epi: if 'dw_scheme' not in dwi_header.keyval(): app.error('No diffusion gradient table found') grad = dwi_header.keyval()['dw_scheme'] -if not len(grad) == num_volumes: +if not len(grad) == dwi_num_volumes: app.error('Number of lines in gradient table (' + str(len(grad)) + ') does not match input image (' + str(dwi_num_volumes) + ' volumes); check your input data') if any(s.startswith('--mporder') for s in eddy_manual_options): slice_encoding_direction = '' @@ -162,44 +168,43 @@ if any(s.startswith('--mporder') for s in eddy_manual_options): # Check the manual options being passed to eddy, ensure they make sense -eddy_manual_options = '' -if app.args.eddy_options: - # Initially process as a list; we'll convert back to a string later - eddy_manual_options = app.args.eddy_options.strip().split() - if '--resamp=lsr' in eddy_manual_options: - app.error('dwipreproc does not currently support least-squares reconstruction; this cannot be simply passed via -eddy_options') - if any(s.startswith('--mporder') for s in eddy_manual_options): - slspec_option = [ s for s in eddy_manual_options if s.startswith('--slspec') ] - if len(slspec_option) > 1: - app.error('--slspec option appears more than once in -eddy_options input; cannot import slice timing') - elif len(slspec_option) == 1: - slspec_file_path = path.fromUser(slspec_option[0][9:], False) - if os.path.isfile(slspec_file_path): - run.function(shutil.copy, slspec_file_path, 'slspec.txt') - eddy_manual_options = [ s for s in eddy_manual_options if not s.startswith('--slspec') ] - eddy_manual_options.append('--slspec=slspec.txt') - else: - app.error('Unable to find \'slspec\' file provided via -eddy_options \" ... --slspec=/path/to/file ... \" (expected location: ' + slspec_file_path + ')') - else: - if 'SliceTiming' not in dwi_header.keyval(): - app.error('Cannot perform slice-to-volume correction in eddy: No slspec file provided, and no slice timing information present in header') - slice_timing = dwi_header.keyval()['SliceTiming'][0] - if len(slice_timing) != dwi_header.size()[2]: - app.error('Cannot use slice timing information in image header for slice-to-volume correction: Number of entries (' + len(slice_timing) + ') does not match number of slices (' + dwi_header.size()[2] + ')') - # This list contains, for each slice, the timing offset between acquisition of the - # first slice in the volume, and acquisition of that slice - # Eddy however requires a text file where each row contains those slices that were - # acquired with a single readout, in ordered rows from first slice (group) - # acquired to last slice (group) acquired - if '-' in slice_encoding_direction: - slice_timing = reversed(slice_timing) - slspec = [ [ x[0] for x in g ] for _, g in itertools.groupby(sorted(enumerate(slice_timing), key=lambda x:x[1]), key=lambda x:x[1]) ] #pylint: disable=unused-variable - app.var(slice_timing, slspec) - with open('slspec.txt', 'w') as f: - for line in slspec: - f.write(' '.join(str(value) for value in line) + '\n') +if '--resamp=lsr' in eddy_manual_options: + app.error('dwipreproc does not currently support least-squares reconstruction; this cannot be simply passed via -eddy_options') +if any(s.startswith('--mporder') for s in eddy_manual_options): + slspec_option = [ s for s in eddy_manual_options if s.startswith('--slspec') ] + if len(slspec_option) > 1: + app.error('--slspec option appears more than once in -eddy_options input; cannot import slice timing') + elif len(slspec_option) == 1: + slspec_file_path = path.fromUser(slspec_option[0][9:], False) + if os.path.isfile(slspec_file_path): + run.function(shutil.copy, slspec_file_path, 'slspec.txt') + eddy_manual_options = [ s for s in eddy_manual_options if not s.startswith('--slspec') ] eddy_manual_options.append('--slspec=slspec.txt') - eddy_manual_options = ' ' + ' '.join(eddy_manual_options) + else: + app.error('Unable to find \'slspec\' file provided via -eddy_options \" ... --slspec=/path/to/file ... \" (expected location: ' + slspec_file_path + ')') + else: + if 'SliceTiming' not in dwi_header.keyval(): + app.error('Cannot perform slice-to-volume correction in eddy: No slspec file provided, and no slice timing information present in header') + slice_timing = dwi_header.keyval()['SliceTiming'][0] + if len(slice_timing) != dwi_header.size()[2]: + app.error('Cannot use slice timing information in image header for slice-to-volume correction: Number of entries (' + len(slice_timing) + ') does not match number of slices (' + dwi_header.size()[2] + ')') + # This list contains, for each slice, the timing offset between acquisition of the + # first slice in the volume, and acquisition of that slice + # Eddy however requires a text file where each row contains those slices that were + # acquired with a single readout, in ordered rows from first slice (group) + # acquired to last slice (group) acquired + if '-' in slice_encoding_direction: + slice_timing = reversed(slice_timing) + slspec = [ [ x[0] for x in g ] for _, g in itertools.groupby(sorted(enumerate(slice_timing), key=lambda x:x[1]), key=lambda x:x[1]) ] #pylint: disable=unused-variable + app.var(slice_timing, slspec) + with open('slspec.txt', 'w') as f: + for line in slspec: + f.write(' '.join(str(value) for value in line) + '\n') + eddy_manual_options.append('--slspec=slspec.txt') + + +# Revert eddy_manual_options from a list back to a single string +eddy_manual_options = (' ' + ' '.join(eddy_manual_options)) if eddy_manual_options else '' # Since we want to access user-defined phase encoding information regardless of whether or not From a5d5b5b72b8d68c200a4250bf6a04f429a7c3d09 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Tue, 24 Oct 2017 17:32:25 +0100 Subject: [PATCH 195/538] build: add persistent mode to carry on building despite errors --- build | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/build b/build index f2fc83bd07..846a5b2b30 100755 --- a/build +++ b/build @@ -69,6 +69,10 @@ OPTIONS -tree [only used with -showdep] print full dependency tree for each file + + -persistent + keep trying to build regardless of failures, until none of the remaining + jobs succeed. ''' @@ -101,6 +105,7 @@ system = None dependencies = 0 dep_recursive = False verbose = False +persistent = False nowarnings = False targets = [] use_multiple_cores = True @@ -280,6 +285,8 @@ for arg in sys.argv[1:]: exit (0) elif '-verbose'.startswith(arg): verbose = True + elif '-persistent'.startswith(arg): + persistent = True elif '-nowarnings'.startswith(arg): nowarnings = True elif '-showdep'.startswith(arg): @@ -957,6 +964,7 @@ def build_next (id): target = todo[current] if target.execute(cindex, formatstr): + todo[item].currently_being_processed = False stop = 2 return @@ -1192,13 +1200,15 @@ log ('TODO list contains ' + str(len(todo)) + ''' items #for entry in todo.values(): entry.display() +try: num_processors = int(os.environ['NUMBER_OF_PROCESSORS']) +except: + try: num_processors = os.sysconf('SC_NPROCESSORS_ONLN') + except: num_processors = 1 -if len(todo): +while len(todo): - try: num_processors = int(os.environ['NUMBER_OF_PROCESSORS']) - except: - try: num_processors = os.sysconf('SC_NPROCESSORS_ONLN') - except: num_processors = 1 + stop = False + num_todo_previous = len(todo) log (''' @@ -1216,6 +1226,21 @@ if len(todo): for t in threads: t.join() + if not persistent: + break + + if len(todo) == num_todo_previous: + disp (''' +stopping despite errors as no jobs completed successfully + +''') + break + + disp (''' +retrying as running in persistent mode + +''') + # generate development-specific files (if needed) # i.e. bash completion and user documentation From 2be3125fd4014d2a3e5401c5b61923a1e871d16f Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Tue, 24 Oct 2017 17:49:33 +0100 Subject: [PATCH 196/538] build: fix minor outstanding issues with persistent mode --- build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build b/build index 846a5b2b30..25bc1c4aa5 100755 --- a/build +++ b/build @@ -1208,6 +1208,7 @@ except: while len(todo): stop = False + main_cindex = 0 num_todo_previous = len(todo) log (''' @@ -1236,7 +1237,8 @@ stopping despite errors as no jobs completed successfully ''') break - disp (''' + if len(todo): + disp (''' retrying as running in persistent mode ''') From 2a7a93adc16e719d7dfa16faed7909cd5286d99a Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Tue, 24 Oct 2017 17:50:08 +0100 Subject: [PATCH 197/538] travis.yml: try using build -persistent with larger number of cores --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ce8052a718..c72df79e75 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ env: - py=python2 - py=python3 install: - - export NUMBER_OF_PROCESSORS=4 + - export NUMBER_OF_PROCESSORS=8 - export PATH=`pwd`/bin:${PATH} - export PYTHONPATH=`pwd`/lib:${PYTHONPATH} - export EIGEN_CFLAGS=-I`pwd`/../eigen @@ -27,8 +27,9 @@ install: - pip install --user pylint recommonmark sphinx sphinx-rtd-theme - pip3 install --user pylint recommonmark sphinx sphinx-rtd-theme script: + - lscpu - ${py} -m sphinx -n -N -W -w sphinx.log -c docs/ docs/ tmp/ - - ./check_memalign && $py ./configure -assert && $py ./build -nowarnings && ./run_tests + - ./check_memalign && $py ./configure -assert && time $py ./build -nowarnings -persistent && ./run_tests - PYTHON=$py ./run_pylint - ./docs/generate_user_docs.sh && git diff --exit-code docs/ > gitdiff.log || echo "Documentation is not up to date; run docs/generate_user_docs.sh and commit changes" after_failure: From 8fec4322cc68f0f87f6f025bef6347fca51ee69e Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Tue, 24 Oct 2017 19:41:33 +0100 Subject: [PATCH 198/538] TravisCI: try reducing number of processes to 2 --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c72df79e75..5af9f9d735 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ env: - py=python2 - py=python3 install: - - export NUMBER_OF_PROCESSORS=8 + - export NUMBER_OF_PROCESSORS=2 - export PATH=`pwd`/bin:${PATH} - export PYTHONPATH=`pwd`/lib:${PYTHONPATH} - export EIGEN_CFLAGS=-I`pwd`/../eigen @@ -27,7 +27,6 @@ install: - pip install --user pylint recommonmark sphinx sphinx-rtd-theme - pip3 install --user pylint recommonmark sphinx sphinx-rtd-theme script: - - lscpu - ${py} -m sphinx -n -N -W -w sphinx.log -c docs/ docs/ tmp/ - ./check_memalign && $py ./configure -assert && time $py ./build -nowarnings -persistent && ./run_tests - PYTHON=$py ./run_pylint From b665fc7774ab960241f3f7c8a83a18ee04da30a4 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Tue, 24 Oct 2017 21:33:28 +0100 Subject: [PATCH 199/538] TravisCI: try 4 processes again... --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5af9f9d735..4978c349bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ env: - py=python2 - py=python3 install: - - export NUMBER_OF_PROCESSORS=2 + - export NUMBER_OF_PROCESSORS=4 - export PATH=`pwd`/bin:${PATH} - export PYTHONPATH=`pwd`/lib:${PYTHONPATH} - export EIGEN_CFLAGS=-I`pwd`/../eigen From 713c43a7f650a5008109bae98d2829c24dd5e1b6 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 25 Oct 2017 11:29:43 +1100 Subject: [PATCH 200/538] mrinfo: Fix -json_all output Voxel spacing was being written to a vector of integers, which inevitably misbehaved if the voxel size in mm was not an integer. Also changed -vox option to -spacing, for better consistency with the new internal nomenclature. --- cmd/mrinfo.cpp | 15 +++++++-------- docs/reference/commands/mrinfo.rst | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/cmd/mrinfo.cpp b/cmd/mrinfo.cpp index f07b78464d..57fff9677b 100644 --- a/cmd/mrinfo.cpp +++ b/cmd/mrinfo.cpp @@ -74,7 +74,7 @@ void usage () + Option ("format", "image file format") + Option ("ndim", "number of image dimensions") + Option ("size", "image size along each axis") - + Option ("vox", "voxel size along each image dimension") + + Option ("spacing", "voxel spacing along each image dimension") + Option ("datatype", "data type used for image data storage") + Option ("stride", "data strides i.e. order and direction of axes data layout") + Option ("offset", "image intensity offset") @@ -119,7 +119,7 @@ void print_dimensions (const Header& header) std::cout << buffer << "\n"; } -void print_vox (const Header& header) +void print_spacing (const Header& header) { std::string buffer; for (size_t i = 0; i < header.ndim(); ++i) { @@ -226,7 +226,8 @@ void header2json (const Header& header, nlohmann::json& json) { // Capture _all_ header fields, not just the optional key-value pairs json["name"] = header.name(); - vector size (header.ndim()), spacing (header.ndim()); + vector size (header.ndim()); + vector spacing (header.ndim()); for (size_t axis = 0; axis != header.ndim(); ++axis) { size[axis] = header.size (axis); spacing[axis] = header.spacing (axis); @@ -275,7 +276,7 @@ void run () const bool format = get_options("format") .size(); const bool ndim = get_options("ndim") .size(); const bool size = get_options("size") .size(); - const bool vox = get_options("vox") .size(); + const bool spacing = get_options("spacing") .size(); const bool datatype = get_options("datatype") .size(); const bool stride = get_options("stride") .size(); const bool offset = get_options("offset") .size(); @@ -288,13 +289,11 @@ void run () const bool raw_dwgrad = get_options("raw_dwgrad") .size(); const bool petable = get_options("petable") .size(); - const bool print_full_header = !(format || ndim || size || vox || datatype || stride || + const bool print_full_header = !(format || ndim || size || spacing || datatype || stride || offset || multiplier || properties.size() || transform || dwgrad || export_grad || shellvalues || shellcounts || export_pe || petable || json_keyval || json_all); - Eigen::IOFormat fmt(Eigen::FullPrecision, 0, ", ", "\n", "", "", "", "\n"); - for (size_t i = 0; i < argument.size(); ++i) { auto header = Header::open (argument[i]); if (raw_dwgrad) @@ -305,7 +304,7 @@ void run () if (format) std::cout << header.format() << "\n"; if (ndim) std::cout << header.ndim() << "\n"; if (size) print_dimensions (header); - if (vox) print_vox (header); + if (spacing) print_spacing (header); if (datatype) std::cout << (header.datatype().specifier() ? header.datatype().specifier() : "invalid") << "\n"; if (stride) print_strides (header); if (offset) std::cout << header.intensity_offset() << "\n"; diff --git a/docs/reference/commands/mrinfo.rst b/docs/reference/commands/mrinfo.rst index 8a4877689c..783132a17f 100644 --- a/docs/reference/commands/mrinfo.rst +++ b/docs/reference/commands/mrinfo.rst @@ -37,7 +37,7 @@ Options - **-size** image size along each axis -- **-vox** voxel size along each image dimension +- **-spacing** voxel spacing along each image dimension - **-datatype** data type used for image data storage From 53cc0764bc289175aa73a4d4b8fab2912927982b Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 25 Oct 2017 12:00:40 +1100 Subject: [PATCH 201/538] Remove -failonwarn option This command-line option is unlikely to be used on a one-off basis. There remains a config file entry "FailOnWarn" that will trigger this behaviour. --- core/app.cpp | 8 ++------ docs/reference/commands/5tt2gmwmi.rst | 4 +--- docs/reference/commands/5tt2vis.rst | 4 +--- docs/reference/commands/5ttcheck.rst | 4 +--- docs/reference/commands/5ttedit.rst | 4 +--- docs/reference/commands/afdconnectivity.rst | 4 +--- docs/reference/commands/amp2response.rst | 4 +--- docs/reference/commands/amp2sh.rst | 4 +--- docs/reference/commands/connectome2tck.rst | 4 +--- docs/reference/commands/connectomestats.rst | 4 +--- docs/reference/commands/dcmedit.rst | 4 +--- docs/reference/commands/dcminfo.rst | 4 +--- docs/reference/commands/dirflip.rst | 4 +--- docs/reference/commands/dirgen.rst | 4 +--- docs/reference/commands/dirmerge.rst | 4 +--- docs/reference/commands/dirorder.rst | 4 +--- docs/reference/commands/dirsplit.rst | 4 +--- docs/reference/commands/dirstat.rst | 4 +--- docs/reference/commands/dwi2adc.rst | 4 +--- docs/reference/commands/dwi2fod.rst | 4 +--- docs/reference/commands/dwi2mask.rst | 4 +--- docs/reference/commands/dwi2noise.rst | 4 +--- docs/reference/commands/dwi2tensor.rst | 4 +--- docs/reference/commands/dwidenoise.rst | 4 +--- docs/reference/commands/dwiextract.rst | 4 +--- docs/reference/commands/dwinormalise.rst | 4 +--- docs/reference/commands/fixel2sh.rst | 4 +--- docs/reference/commands/fixel2tsf.rst | 4 +--- docs/reference/commands/fixel2voxel.rst | 4 +--- docs/reference/commands/fixelcfestats.rst | 4 +--- docs/reference/commands/fixelconvert.rst | 4 +--- docs/reference/commands/fixelcorrespondence.rst | 4 +--- docs/reference/commands/fixelcrop.rst | 4 +--- docs/reference/commands/fixelreorient.rst | 4 +--- docs/reference/commands/fod2dec.rst | 4 +--- docs/reference/commands/fod2fixel.rst | 4 +--- docs/reference/commands/label2colour.rst | 4 +--- docs/reference/commands/label2mesh.rst | 4 +--- docs/reference/commands/labelconvert.rst | 4 +--- docs/reference/commands/maskdump.rst | 4 +--- docs/reference/commands/maskfilter.rst | 4 +--- docs/reference/commands/mesh2pve.rst | 4 +--- docs/reference/commands/meshconvert.rst | 4 +--- docs/reference/commands/meshfilter.rst | 4 +--- docs/reference/commands/mraverageheader.rst | 4 +--- docs/reference/commands/mrcalc.rst | 4 +--- docs/reference/commands/mrcat.rst | 4 +--- docs/reference/commands/mrcheckerboardmask.rst | 4 +--- docs/reference/commands/mrclusterstats.rst | 4 +--- docs/reference/commands/mrconvert.rst | 4 +--- docs/reference/commands/mrcrop.rst | 4 +--- docs/reference/commands/mrdegibbs.rst | 4 +--- docs/reference/commands/mrdump.rst | 4 +--- docs/reference/commands/mredit.rst | 4 +--- docs/reference/commands/mrfilter.rst | 4 +--- docs/reference/commands/mrhistmatch.rst | 4 +--- docs/reference/commands/mrhistogram.rst | 4 +--- docs/reference/commands/mrinfo.rst | 4 +--- docs/reference/commands/mrmath.rst | 4 +--- docs/reference/commands/mrmesh.rst | 4 +--- docs/reference/commands/mrmetric.rst | 4 +--- docs/reference/commands/mrpad.rst | 4 +--- docs/reference/commands/mrregister.rst | 4 +--- docs/reference/commands/mrresize.rst | 4 +--- docs/reference/commands/mrstats.rst | 4 +--- docs/reference/commands/mrthreshold.rst | 4 +--- docs/reference/commands/mrtransform.rst | 4 +--- docs/reference/commands/mrview.rst | 4 +--- docs/reference/commands/mtbin.rst | 4 +--- docs/reference/commands/mtnormalise.rst | 4 +--- docs/reference/commands/peaks2amp.rst | 4 +--- docs/reference/commands/sh2amp.rst | 4 +--- docs/reference/commands/sh2peaks.rst | 4 +--- docs/reference/commands/sh2power.rst | 4 +--- docs/reference/commands/sh2response.rst | 4 +--- docs/reference/commands/shbasis.rst | 4 +--- docs/reference/commands/shconv.rst | 4 +--- docs/reference/commands/shview.rst | 4 +--- docs/reference/commands/tck2connectome.rst | 4 +--- docs/reference/commands/tck2fixel.rst | 4 +--- docs/reference/commands/tckconvert.rst | 4 +--- docs/reference/commands/tckdfc.rst | 4 +--- docs/reference/commands/tckedit.rst | 4 +--- docs/reference/commands/tckgen.rst | 4 +--- docs/reference/commands/tckglobal.rst | 4 +--- docs/reference/commands/tckinfo.rst | 4 +--- docs/reference/commands/tckmap.rst | 4 +--- docs/reference/commands/tcknormalise.rst | 4 +--- docs/reference/commands/tckresample.rst | 4 +--- docs/reference/commands/tcksample.rst | 4 +--- docs/reference/commands/tcksift.rst | 4 +--- docs/reference/commands/tcksift2.rst | 4 +--- docs/reference/commands/tckstats.rst | 4 +--- docs/reference/commands/tensor2metric.rst | 4 +--- docs/reference/commands/transformcalc.rst | 4 +--- docs/reference/commands/transformcompose.rst | 4 +--- docs/reference/commands/transformconvert.rst | 4 +--- docs/reference/commands/tsfdivide.rst | 4 +--- docs/reference/commands/tsfinfo.rst | 4 +--- docs/reference/commands/tsfmult.rst | 4 +--- docs/reference/commands/tsfsmooth.rst | 4 +--- docs/reference/commands/tsfthreshold.rst | 4 +--- docs/reference/commands/vectorstats.rst | 4 +--- docs/reference/commands/voxel2fixel.rst | 4 +--- docs/reference/commands/warp2metric.rst | 4 +--- docs/reference/commands/warpconvert.rst | 4 +--- docs/reference/commands/warpcorrect.rst | 4 +--- docs/reference/commands/warpinit.rst | 4 +--- docs/reference/commands/warpinvert.rst | 4 +--- 109 files changed, 110 insertions(+), 330 deletions(-) diff --git a/core/app.cpp b/core/app.cpp index d3816e8d0a..cc92af1ce8 100644 --- a/core/app.cpp +++ b/core/app.cpp @@ -48,9 +48,8 @@ namespace MR + Option ("debug", "display debugging messages.") + Option ("force", "force overwrite of output files. " "Caution: Using the same file as input and output might cause unexpected behaviour.") - + Option ("nthreads", "use this number of threads in multi-threaded applications (set to 0 to disable multi-threading)") + + Option ("nthreads", "use this number of threads in multi-threaded applications (set to 0 to disable multi-threading).") + Argument ("number").type_integer (0) - + Option ("failonwarn", "terminate program if a warning is produced") + Option ("help", "display this information page and exit.") + Option ("version", "display version information and exit."); @@ -882,8 +881,6 @@ namespace MR WARN ("existing output files will be overwritten"); overwrite_files = true; } - if (get_options ("failonwarn").size()) - fail_on_warn = true; } @@ -1034,8 +1031,7 @@ namespace MR //CONF default: 0 (false) //CONF A boolean value specifying whether MRtrix applications should //CONF abort as soon as any (otherwise non-fatal) warning is issued. - if (File::Config::get_bool ("FailOnWarn", false)) - fail_on_warn = true; + fail_on_warn = File::Config::get_bool ("FailOnWarn", false); //CONF option: TerminalColor //CONF default: 1 (true) diff --git a/docs/reference/commands/5tt2gmwmi.rst b/docs/reference/commands/5tt2gmwmi.rst index 8762b219a1..5293511ea4 100644 --- a/docs/reference/commands/5tt2gmwmi.rst +++ b/docs/reference/commands/5tt2gmwmi.rst @@ -34,9 +34,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/5tt2vis.rst b/docs/reference/commands/5tt2vis.rst index 0eb3b513ac..14ec02ad68 100644 --- a/docs/reference/commands/5tt2vis.rst +++ b/docs/reference/commands/5tt2vis.rst @@ -44,9 +44,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/5ttcheck.rst b/docs/reference/commands/5ttcheck.rst index cb76344267..47032c8d69 100644 --- a/docs/reference/commands/5ttcheck.rst +++ b/docs/reference/commands/5ttcheck.rst @@ -33,9 +33,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/5ttedit.rst b/docs/reference/commands/5ttedit.rst index afb0c4af49..d48e179d70 100644 --- a/docs/reference/commands/5ttedit.rst +++ b/docs/reference/commands/5ttedit.rst @@ -44,9 +44,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/afdconnectivity.rst b/docs/reference/commands/afdconnectivity.rst index 3440306b5f..a4064f8f70 100644 --- a/docs/reference/commands/afdconnectivity.rst +++ b/docs/reference/commands/afdconnectivity.rst @@ -51,9 +51,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/amp2response.rst b/docs/reference/commands/amp2response.rst index 22b33ea790..c6801a0677 100644 --- a/docs/reference/commands/amp2response.rst +++ b/docs/reference/commands/amp2response.rst @@ -56,9 +56,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/amp2sh.rst b/docs/reference/commands/amp2sh.rst index 7a430cdbec..3b64abae63 100644 --- a/docs/reference/commands/amp2sh.rst +++ b/docs/reference/commands/amp2sh.rst @@ -68,9 +68,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/connectome2tck.rst b/docs/reference/commands/connectome2tck.rst index 98fa22ecf8..02cc615d7d 100644 --- a/docs/reference/commands/connectome2tck.rst +++ b/docs/reference/commands/connectome2tck.rst @@ -60,9 +60,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/connectomestats.rst b/docs/reference/commands/connectomestats.rst index 405afd9a09..551f0bf389 100644 --- a/docs/reference/commands/connectomestats.rst +++ b/docs/reference/commands/connectomestats.rst @@ -64,9 +64,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/dcmedit.rst b/docs/reference/commands/dcmedit.rst index 54840e787b..a12ccee4c8 100644 --- a/docs/reference/commands/dcmedit.rst +++ b/docs/reference/commands/dcmedit.rst @@ -44,9 +44,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/dcminfo.rst b/docs/reference/commands/dcminfo.rst index 67547cec73..9c182ceb3b 100644 --- a/docs/reference/commands/dcminfo.rst +++ b/docs/reference/commands/dcminfo.rst @@ -37,9 +37,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/dirflip.rst b/docs/reference/commands/dirflip.rst index bdc556ba36..3d4da12573 100644 --- a/docs/reference/commands/dirflip.rst +++ b/docs/reference/commands/dirflip.rst @@ -41,9 +41,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/dirgen.rst b/docs/reference/commands/dirgen.rst index ee52425850..06485af21f 100644 --- a/docs/reference/commands/dirgen.rst +++ b/docs/reference/commands/dirgen.rst @@ -47,9 +47,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/dirmerge.rst b/docs/reference/commands/dirmerge.rst index ea00e52b90..b2ecdd1612 100644 --- a/docs/reference/commands/dirmerge.rst +++ b/docs/reference/commands/dirmerge.rst @@ -35,9 +35,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/dirorder.rst b/docs/reference/commands/dirorder.rst index 157d0c8f43..4715a2d41c 100644 --- a/docs/reference/commands/dirorder.rst +++ b/docs/reference/commands/dirorder.rst @@ -34,9 +34,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/dirsplit.rst b/docs/reference/commands/dirsplit.rst index 67470857a9..1838542f04 100644 --- a/docs/reference/commands/dirsplit.rst +++ b/docs/reference/commands/dirsplit.rst @@ -36,9 +36,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/dirstat.rst b/docs/reference/commands/dirstat.rst index 688baf4429..1dc9d22be8 100644 --- a/docs/reference/commands/dirstat.rst +++ b/docs/reference/commands/dirstat.rst @@ -31,9 +31,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/dwi2adc.rst b/docs/reference/commands/dwi2adc.rst index 38a89ef9eb..8092e68789 100644 --- a/docs/reference/commands/dwi2adc.rst +++ b/docs/reference/commands/dwi2adc.rst @@ -41,9 +41,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/dwi2fod.rst b/docs/reference/commands/dwi2fod.rst index 6c94bd86ee..7b686546fe 100644 --- a/docs/reference/commands/dwi2fod.rst +++ b/docs/reference/commands/dwi2fod.rst @@ -79,9 +79,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/dwi2mask.rst b/docs/reference/commands/dwi2mask.rst index 78e046cf62..919b9027a9 100644 --- a/docs/reference/commands/dwi2mask.rst +++ b/docs/reference/commands/dwi2mask.rst @@ -50,9 +50,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/dwi2noise.rst b/docs/reference/commands/dwi2noise.rst index 48ce32ac7d..328a50d479 100644 --- a/docs/reference/commands/dwi2noise.rst +++ b/docs/reference/commands/dwi2noise.rst @@ -53,9 +53,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/dwi2tensor.rst b/docs/reference/commands/dwi2tensor.rst index 6fbcd77680..f442e6dd2b 100644 --- a/docs/reference/commands/dwi2tensor.rst +++ b/docs/reference/commands/dwi2tensor.rst @@ -56,9 +56,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/dwidenoise.rst b/docs/reference/commands/dwidenoise.rst index b3bf440fa6..bdb96f897f 100644 --- a/docs/reference/commands/dwidenoise.rst +++ b/docs/reference/commands/dwidenoise.rst @@ -47,9 +47,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/dwiextract.rst b/docs/reference/commands/dwiextract.rst index 95a3482fb4..9477e90ba1 100644 --- a/docs/reference/commands/dwiextract.rst +++ b/docs/reference/commands/dwiextract.rst @@ -69,9 +69,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/dwinormalise.rst b/docs/reference/commands/dwinormalise.rst index 4fd0fb5c75..2d722cb864 100644 --- a/docs/reference/commands/dwinormalise.rst +++ b/docs/reference/commands/dwinormalise.rst @@ -46,9 +46,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/fixel2sh.rst b/docs/reference/commands/fixel2sh.rst index 9df42eb97f..4e030dacb3 100644 --- a/docs/reference/commands/fixel2sh.rst +++ b/docs/reference/commands/fixel2sh.rst @@ -39,9 +39,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/fixel2tsf.rst b/docs/reference/commands/fixel2tsf.rst index 6ba77a8059..f9ebda145f 100644 --- a/docs/reference/commands/fixel2tsf.rst +++ b/docs/reference/commands/fixel2tsf.rst @@ -40,9 +40,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/fixel2voxel.rst b/docs/reference/commands/fixel2voxel.rst index 784a8c6453..2d129fb147 100644 --- a/docs/reference/commands/fixel2voxel.rst +++ b/docs/reference/commands/fixel2voxel.rst @@ -54,9 +54,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/fixelcfestats.rst b/docs/reference/commands/fixelcfestats.rst index 7e8655a4bd..4b6faa40cc 100644 --- a/docs/reference/commands/fixelcfestats.rst +++ b/docs/reference/commands/fixelcfestats.rst @@ -80,9 +80,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/fixelconvert.rst b/docs/reference/commands/fixelconvert.rst index 38af9e086f..739afad4d3 100644 --- a/docs/reference/commands/fixelconvert.rst +++ b/docs/reference/commands/fixelconvert.rst @@ -50,9 +50,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/fixelcorrespondence.rst b/docs/reference/commands/fixelcorrespondence.rst index b6ee9574c7..afbb47f2fd 100644 --- a/docs/reference/commands/fixelcorrespondence.rst +++ b/docs/reference/commands/fixelcorrespondence.rst @@ -41,9 +41,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/fixelcrop.rst b/docs/reference/commands/fixelcrop.rst index 5032c0674c..642d45d5eb 100644 --- a/docs/reference/commands/fixelcrop.rst +++ b/docs/reference/commands/fixelcrop.rst @@ -38,9 +38,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/fixelreorient.rst b/docs/reference/commands/fixelreorient.rst index 800efdc5d6..a68580c324 100644 --- a/docs/reference/commands/fixelreorient.rst +++ b/docs/reference/commands/fixelreorient.rst @@ -38,9 +38,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/fod2dec.rst b/docs/reference/commands/fod2dec.rst index c489ca5755..a4fc3bd746 100644 --- a/docs/reference/commands/fod2dec.rst +++ b/docs/reference/commands/fod2dec.rst @@ -51,9 +51,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/fod2fixel.rst b/docs/reference/commands/fod2fixel.rst index c122932a07..c462023677 100644 --- a/docs/reference/commands/fod2fixel.rst +++ b/docs/reference/commands/fod2fixel.rst @@ -63,9 +63,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/label2colour.rst b/docs/reference/commands/label2colour.rst index 490499ade5..517793770b 100644 --- a/docs/reference/commands/label2colour.rst +++ b/docs/reference/commands/label2colour.rst @@ -39,9 +39,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/label2mesh.rst b/docs/reference/commands/label2mesh.rst index af06b5ba72..b3a63dbb08 100644 --- a/docs/reference/commands/label2mesh.rst +++ b/docs/reference/commands/label2mesh.rst @@ -34,9 +34,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/labelconvert.rst b/docs/reference/commands/labelconvert.rst index a11ba9dfe3..f501deddef 100644 --- a/docs/reference/commands/labelconvert.rst +++ b/docs/reference/commands/labelconvert.rst @@ -41,9 +41,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/maskdump.rst b/docs/reference/commands/maskdump.rst index b03f76f3a5..dcb2524da9 100644 --- a/docs/reference/commands/maskdump.rst +++ b/docs/reference/commands/maskdump.rst @@ -37,9 +37,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/maskfilter.rst b/docs/reference/commands/maskfilter.rst index be04679c70..3b3c247d49 100644 --- a/docs/reference/commands/maskfilter.rst +++ b/docs/reference/commands/maskfilter.rst @@ -69,9 +69,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mesh2pve.rst b/docs/reference/commands/mesh2pve.rst index be95625eb3..49873b42a7 100644 --- a/docs/reference/commands/mesh2pve.rst +++ b/docs/reference/commands/mesh2pve.rst @@ -33,9 +33,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/meshconvert.rst b/docs/reference/commands/meshconvert.rst index 3f159609d8..214b63addd 100644 --- a/docs/reference/commands/meshconvert.rst +++ b/docs/reference/commands/meshconvert.rst @@ -36,9 +36,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/meshfilter.rst b/docs/reference/commands/meshfilter.rst index 28e989f19c..2992fa9432 100644 --- a/docs/reference/commands/meshfilter.rst +++ b/docs/reference/commands/meshfilter.rst @@ -40,9 +40,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mraverageheader.rst b/docs/reference/commands/mraverageheader.rst index e76239cd43..03d20d0928 100644 --- a/docs/reference/commands/mraverageheader.rst +++ b/docs/reference/commands/mraverageheader.rst @@ -43,9 +43,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrcalc.rst b/docs/reference/commands/mrcalc.rst index 535c62447c..415b8c6d30 100644 --- a/docs/reference/commands/mrcalc.rst +++ b/docs/reference/commands/mrcalc.rst @@ -154,9 +154,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrcat.rst b/docs/reference/commands/mrcat.rst index 80d6b8078b..f382bbb1b0 100644 --- a/docs/reference/commands/mrcat.rst +++ b/docs/reference/commands/mrcat.rst @@ -40,9 +40,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrcheckerboardmask.rst b/docs/reference/commands/mrcheckerboardmask.rst index 2d4e19645f..06bb4f21cc 100644 --- a/docs/reference/commands/mrcheckerboardmask.rst +++ b/docs/reference/commands/mrcheckerboardmask.rst @@ -38,9 +38,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrclusterstats.rst b/docs/reference/commands/mrclusterstats.rst index fb86f87bfe..6f80ec2a1f 100644 --- a/docs/reference/commands/mrclusterstats.rst +++ b/docs/reference/commands/mrclusterstats.rst @@ -68,9 +68,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrconvert.rst b/docs/reference/commands/mrconvert.rst index 1371bc9271..975e25f2dd 100644 --- a/docs/reference/commands/mrconvert.rst +++ b/docs/reference/commands/mrconvert.rst @@ -116,9 +116,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrcrop.rst b/docs/reference/commands/mrcrop.rst index a568c17f74..18a5f3c0d5 100644 --- a/docs/reference/commands/mrcrop.rst +++ b/docs/reference/commands/mrcrop.rst @@ -45,9 +45,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrdegibbs.rst b/docs/reference/commands/mrdegibbs.rst index 7a2c033cfc..a2037e0d04 100644 --- a/docs/reference/commands/mrdegibbs.rst +++ b/docs/reference/commands/mrdegibbs.rst @@ -54,9 +54,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrdump.rst b/docs/reference/commands/mrdump.rst index 917fc4d9cb..2865b7e387 100644 --- a/docs/reference/commands/mrdump.rst +++ b/docs/reference/commands/mrdump.rst @@ -39,9 +39,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mredit.rst b/docs/reference/commands/mredit.rst index 05ff54a6f1..525224fda6 100644 --- a/docs/reference/commands/mredit.rst +++ b/docs/reference/commands/mredit.rst @@ -45,9 +45,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrfilter.rst b/docs/reference/commands/mrfilter.rst index 40c2e264ce..c1c8045da6 100644 --- a/docs/reference/commands/mrfilter.rst +++ b/docs/reference/commands/mrfilter.rst @@ -86,9 +86,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrhistmatch.rst b/docs/reference/commands/mrhistmatch.rst index ec2cce430a..8b1a75f47f 100644 --- a/docs/reference/commands/mrhistmatch.rst +++ b/docs/reference/commands/mrhistmatch.rst @@ -41,9 +41,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrhistogram.rst b/docs/reference/commands/mrhistogram.rst index a1600df40c..82e7832c55 100644 --- a/docs/reference/commands/mrhistogram.rst +++ b/docs/reference/commands/mrhistogram.rst @@ -48,9 +48,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrinfo.rst b/docs/reference/commands/mrinfo.rst index 8a4877689c..e23bec68ba 100644 --- a/docs/reference/commands/mrinfo.rst +++ b/docs/reference/commands/mrinfo.rst @@ -104,9 +104,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrmath.rst b/docs/reference/commands/mrmath.rst index 2ce4c64cc6..25d77478c5 100644 --- a/docs/reference/commands/mrmath.rst +++ b/docs/reference/commands/mrmath.rst @@ -49,9 +49,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrmesh.rst b/docs/reference/commands/mrmesh.rst index d56c377527..b6b38ec7df 100644 --- a/docs/reference/commands/mrmesh.rst +++ b/docs/reference/commands/mrmesh.rst @@ -36,9 +36,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrmetric.rst b/docs/reference/commands/mrmetric.rst index a1b7454d7c..bcede4c5eb 100644 --- a/docs/reference/commands/mrmetric.rst +++ b/docs/reference/commands/mrmetric.rst @@ -51,9 +51,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrpad.rst b/docs/reference/commands/mrpad.rst index 66bd64fa7c..e03fa0f5ad 100644 --- a/docs/reference/commands/mrpad.rst +++ b/docs/reference/commands/mrpad.rst @@ -36,9 +36,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrregister.rst b/docs/reference/commands/mrregister.rst index f622d6c5c4..ed8e1fa8dc 100644 --- a/docs/reference/commands/mrregister.rst +++ b/docs/reference/commands/mrregister.rst @@ -172,9 +172,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrresize.rst b/docs/reference/commands/mrresize.rst index 1daaa0501a..dad1faed04 100644 --- a/docs/reference/commands/mrresize.rst +++ b/docs/reference/commands/mrresize.rst @@ -52,9 +52,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrstats.rst b/docs/reference/commands/mrstats.rst index d9277c1cc5..de942c4454 100644 --- a/docs/reference/commands/mrstats.rst +++ b/docs/reference/commands/mrstats.rst @@ -45,9 +45,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrthreshold.rst b/docs/reference/commands/mrthreshold.rst index c985c0fb40..2ddbf0b6a7 100644 --- a/docs/reference/commands/mrthreshold.rst +++ b/docs/reference/commands/mrthreshold.rst @@ -57,9 +57,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrtransform.rst b/docs/reference/commands/mrtransform.rst index 6cee9b69b0..d4024ea165 100644 --- a/docs/reference/commands/mrtransform.rst +++ b/docs/reference/commands/mrtransform.rst @@ -101,9 +101,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mrview.rst b/docs/reference/commands/mrview.rst index f36a65ab39..6490fe771f 100644 --- a/docs/reference/commands/mrview.rst +++ b/docs/reference/commands/mrview.rst @@ -177,9 +177,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mtbin.rst b/docs/reference/commands/mtbin.rst index 15324d8da3..fdc8401120 100644 --- a/docs/reference/commands/mtbin.rst +++ b/docs/reference/commands/mtbin.rst @@ -50,9 +50,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/mtnormalise.rst b/docs/reference/commands/mtnormalise.rst index 4bef89ae0c..95e4fd2da2 100644 --- a/docs/reference/commands/mtnormalise.rst +++ b/docs/reference/commands/mtnormalise.rst @@ -52,9 +52,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/peaks2amp.rst b/docs/reference/commands/peaks2amp.rst index f5a43cc58c..8c2f26acfa 100644 --- a/docs/reference/commands/peaks2amp.rst +++ b/docs/reference/commands/peaks2amp.rst @@ -32,9 +32,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/sh2amp.rst b/docs/reference/commands/sh2amp.rst index 9f38807742..a78024b66a 100644 --- a/docs/reference/commands/sh2amp.rst +++ b/docs/reference/commands/sh2amp.rst @@ -47,9 +47,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/sh2peaks.rst b/docs/reference/commands/sh2peaks.rst index 51fbdda760..199a9e344c 100644 --- a/docs/reference/commands/sh2peaks.rst +++ b/docs/reference/commands/sh2peaks.rst @@ -44,9 +44,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/sh2power.rst b/docs/reference/commands/sh2power.rst index 694814542a..aa114d303d 100644 --- a/docs/reference/commands/sh2power.rst +++ b/docs/reference/commands/sh2power.rst @@ -39,9 +39,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/sh2response.rst b/docs/reference/commands/sh2response.rst index f054675166..d3d93c12d1 100644 --- a/docs/reference/commands/sh2response.rst +++ b/docs/reference/commands/sh2response.rst @@ -38,9 +38,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/shbasis.rst b/docs/reference/commands/shbasis.rst index 56e6318d08..4c95ada87e 100644 --- a/docs/reference/commands/shbasis.rst +++ b/docs/reference/commands/shbasis.rst @@ -40,9 +40,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/shconv.rst b/docs/reference/commands/shconv.rst index d4b9458ff0..dd587e19cf 100644 --- a/docs/reference/commands/shconv.rst +++ b/docs/reference/commands/shconv.rst @@ -40,9 +40,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/shview.rst b/docs/reference/commands/shview.rst index 12c63a9523..01f8171278 100644 --- a/docs/reference/commands/shview.rst +++ b/docs/reference/commands/shview.rst @@ -33,9 +33,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tck2connectome.rst b/docs/reference/commands/tck2connectome.rst index 07d6cc27dd..8a0a0b1fa1 100644 --- a/docs/reference/commands/tck2connectome.rst +++ b/docs/reference/commands/tck2connectome.rst @@ -77,9 +77,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tck2fixel.rst b/docs/reference/commands/tck2fixel.rst index 5ce37fdf68..fe72638ef2 100644 --- a/docs/reference/commands/tck2fixel.rst +++ b/docs/reference/commands/tck2fixel.rst @@ -36,9 +36,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tckconvert.rst b/docs/reference/commands/tckconvert.rst index 7d738f6ac0..83005b68d6 100644 --- a/docs/reference/commands/tckconvert.rst +++ b/docs/reference/commands/tckconvert.rst @@ -68,9 +68,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tckdfc.rst b/docs/reference/commands/tckdfc.rst index 27ed13ff81..627b4dba89 100644 --- a/docs/reference/commands/tckdfc.rst +++ b/docs/reference/commands/tckdfc.rst @@ -69,9 +69,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tckedit.rst b/docs/reference/commands/tckedit.rst index 8dc9f9b721..732f310a86 100644 --- a/docs/reference/commands/tckedit.rst +++ b/docs/reference/commands/tckedit.rst @@ -83,9 +83,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tckgen.rst b/docs/reference/commands/tckgen.rst index b56b0a9017..4dcd7bd144 100644 --- a/docs/reference/commands/tckgen.rst +++ b/docs/reference/commands/tckgen.rst @@ -148,9 +148,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tckglobal.rst b/docs/reference/commands/tckglobal.rst index 2cbace1a29..88dec19462 100644 --- a/docs/reference/commands/tckglobal.rst +++ b/docs/reference/commands/tckglobal.rst @@ -98,9 +98,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tckinfo.rst b/docs/reference/commands/tckinfo.rst index 7e80dfe6b5..68fd589b70 100644 --- a/docs/reference/commands/tckinfo.rst +++ b/docs/reference/commands/tckinfo.rst @@ -33,9 +33,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tckmap.rst b/docs/reference/commands/tckmap.rst index a6f14008f5..f8227a71e3 100644 --- a/docs/reference/commands/tckmap.rst +++ b/docs/reference/commands/tckmap.rst @@ -85,9 +85,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tcknormalise.rst b/docs/reference/commands/tcknormalise.rst index 2116dda1d9..67cafcdd1e 100644 --- a/docs/reference/commands/tcknormalise.rst +++ b/docs/reference/commands/tcknormalise.rst @@ -33,9 +33,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tckresample.rst b/docs/reference/commands/tckresample.rst index f8f8653591..557f5e1a25 100644 --- a/docs/reference/commands/tckresample.rst +++ b/docs/reference/commands/tckresample.rst @@ -56,9 +56,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tcksample.rst b/docs/reference/commands/tcksample.rst index 40bd426b31..9a46fd71d9 100644 --- a/docs/reference/commands/tcksample.rst +++ b/docs/reference/commands/tcksample.rst @@ -46,9 +46,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tcksift.rst b/docs/reference/commands/tcksift.rst index f14358d734..36628e3cb5 100644 --- a/docs/reference/commands/tcksift.rst +++ b/docs/reference/commands/tcksift.rst @@ -77,9 +77,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tcksift2.rst b/docs/reference/commands/tcksift2.rst index 0b64d9aef4..01c31feab4 100644 --- a/docs/reference/commands/tcksift2.rst +++ b/docs/reference/commands/tcksift2.rst @@ -92,9 +92,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tckstats.rst b/docs/reference/commands/tckstats.rst index 0e51938549..6089aa3a9d 100644 --- a/docs/reference/commands/tckstats.rst +++ b/docs/reference/commands/tckstats.rst @@ -41,9 +41,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tensor2metric.rst b/docs/reference/commands/tensor2metric.rst index 8b91023175..7c2f7af181 100644 --- a/docs/reference/commands/tensor2metric.rst +++ b/docs/reference/commands/tensor2metric.rst @@ -55,9 +55,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/transformcalc.rst b/docs/reference/commands/transformcalc.rst index 197590287a..b060fdae52 100644 --- a/docs/reference/commands/transformcalc.rst +++ b/docs/reference/commands/transformcalc.rst @@ -68,9 +68,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/transformcompose.rst b/docs/reference/commands/transformcompose.rst index 11ad550c15..904d6f5efc 100644 --- a/docs/reference/commands/transformcompose.rst +++ b/docs/reference/commands/transformcompose.rst @@ -39,9 +39,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/transformconvert.rst b/docs/reference/commands/transformconvert.rst index 38f8b8b2f2..ee99e1517f 100644 --- a/docs/reference/commands/transformconvert.rst +++ b/docs/reference/commands/transformconvert.rst @@ -38,9 +38,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tsfdivide.rst b/docs/reference/commands/tsfdivide.rst index 07d017972c..d295c239f4 100644 --- a/docs/reference/commands/tsfdivide.rst +++ b/docs/reference/commands/tsfdivide.rst @@ -33,9 +33,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tsfinfo.rst b/docs/reference/commands/tsfinfo.rst index c1a91fdd22..1c7422e61a 100644 --- a/docs/reference/commands/tsfinfo.rst +++ b/docs/reference/commands/tsfinfo.rst @@ -35,9 +35,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tsfmult.rst b/docs/reference/commands/tsfmult.rst index 5d2edf8960..0b9042d554 100644 --- a/docs/reference/commands/tsfmult.rst +++ b/docs/reference/commands/tsfmult.rst @@ -33,9 +33,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tsfsmooth.rst b/docs/reference/commands/tsfsmooth.rst index eed0c8e8e3..62642579e3 100644 --- a/docs/reference/commands/tsfsmooth.rst +++ b/docs/reference/commands/tsfsmooth.rst @@ -34,9 +34,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/tsfthreshold.rst b/docs/reference/commands/tsfthreshold.rst index 586c1e706b..7245ac41c1 100644 --- a/docs/reference/commands/tsfthreshold.rst +++ b/docs/reference/commands/tsfthreshold.rst @@ -35,9 +35,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/vectorstats.rst b/docs/reference/commands/vectorstats.rst index c55361ea33..5ff75869cf 100644 --- a/docs/reference/commands/vectorstats.rst +++ b/docs/reference/commands/vectorstats.rst @@ -43,9 +43,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/voxel2fixel.rst b/docs/reference/commands/voxel2fixel.rst index afc88bfbc7..122b43bc41 100644 --- a/docs/reference/commands/voxel2fixel.rst +++ b/docs/reference/commands/voxel2fixel.rst @@ -39,9 +39,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/warp2metric.rst b/docs/reference/commands/warp2metric.rst index bfdf9926a5..bbeb3e1eeb 100644 --- a/docs/reference/commands/warp2metric.rst +++ b/docs/reference/commands/warp2metric.rst @@ -37,9 +37,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/warpconvert.rst b/docs/reference/commands/warpconvert.rst index 0a492aba01..6f73b64f77 100644 --- a/docs/reference/commands/warpconvert.rst +++ b/docs/reference/commands/warpconvert.rst @@ -44,9 +44,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/warpcorrect.rst b/docs/reference/commands/warpcorrect.rst index 8eeb359cf8..40feaed2f2 100644 --- a/docs/reference/commands/warpcorrect.rst +++ b/docs/reference/commands/warpcorrect.rst @@ -37,9 +37,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/warpinit.rst b/docs/reference/commands/warpinit.rst index 7661664cbf..48faea4cec 100644 --- a/docs/reference/commands/warpinit.rst +++ b/docs/reference/commands/warpinit.rst @@ -43,9 +43,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. diff --git a/docs/reference/commands/warpinvert.rst b/docs/reference/commands/warpinvert.rst index 208570184e..8aace8123d 100644 --- a/docs/reference/commands/warpinvert.rst +++ b/docs/reference/commands/warpinvert.rst @@ -41,9 +41,7 @@ Standard options - **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading) - -- **-failonwarn** terminate program if a warning is produced +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - **-help** display this information page and exit. From 32e8cf179f070fbd023196a9f90b33c5d481093f Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Wed, 25 Oct 2017 08:48:08 +0100 Subject: [PATCH 202/538] configure: add -nooptim flag --- .travis.yml | 4 ++-- configure | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4978c349bd..1996b41301 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ env: - py=python2 - py=python3 install: - - export NUMBER_OF_PROCESSORS=4 + - export NUMBER_OF_PROCESSORS=2 - export PATH=`pwd`/bin:${PATH} - export PYTHONPATH=`pwd`/lib:${PYTHONPATH} - export EIGEN_CFLAGS=-I`pwd`/../eigen @@ -28,7 +28,7 @@ install: - pip3 install --user pylint recommonmark sphinx sphinx-rtd-theme script: - ${py} -m sphinx -n -N -W -w sphinx.log -c docs/ docs/ tmp/ - - ./check_memalign && $py ./configure -assert && time $py ./build -nowarnings -persistent && ./run_tests + - ./check_memalign && $py ./configure -assert -nooptim && time $py ./build -nowarnings && ./run_tests - PYTHON=$py ./run_pylint - ./docs/generate_user_docs.sh && git diff --exit-code docs/ > gitdiff.log || echo "Documentation is not up to date; run docs/generate_user_docs.sh and commit changes" after_failure: diff --git a/configure b/configure index 361a0aa6cd..9714e9d7cd 100755 --- a/configure +++ b/configure @@ -31,6 +31,8 @@ OPTIONS -debug enable debugging symbols. -assert enable all assert() and related checks. + + -nooptim disable optimisation (implied by -debug and -profile). -profile enable profiling. @@ -148,6 +150,7 @@ import subprocess, sys, os, platform, tempfile, shutil, shlex, re, copy debug = False asserts = False +nooptim = False profile = False nogui = False noshared = False @@ -159,10 +162,11 @@ sh_basis_def = None dev = False for arg in sys.argv[1:]: - if '-debug'.startswith (arg): debug = True + if '-debug'.startswith (arg): debug = nooptim = True elif '-dev'.startswith (arg): dev = True elif '-assert'.startswith (arg): asserts = True - elif '-profile'.startswith (arg): profile = True + elif '-nooptim'.startswith (arg): nooptim = True + elif '-profile'.startswith (arg): profile = nooptim = True elif '-nogui'.startswith (arg): nogui = True elif '-noortho'.startswith (arg): sh_basis_def = '-DUSE_NON_ORTHONORMAL_SH_BASIS' elif '-noshared'.startswith (arg): noshared = True @@ -213,6 +217,7 @@ if profile: report ('profiling') elif debug: report ('debug') else: report ('release') if asserts: report (' with asserts') +if nooptim: report (' without optimisation') if nogui: report (' [command-line only]') report ('\n\n') @@ -1251,10 +1256,12 @@ if profile: ld_flags += [ '-g', '-pg' ] ld_lib_flags += [ '-g', '-pg' ] elif debug: - cpp_flags += [ '-O1' ] cpp_flags += [ '-g' ] ld_flags += [ '-g' ] ld_lib_flags += [ '-g' ] + +if nooptim: + cpp_flags += [ '-O0' ] else: cpp_flags += [ '-O3' ] From c88b4d00f6db4ded853d83d60b3c42d2725bad2d Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 26 Oct 2017 00:37:01 +1100 Subject: [PATCH 203/538] Experimenting with TravisCI changes Try to construct a build matrix where each job only runs a subset of the required tests. --- .travis.yml | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index ce8052a718..938951ae6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,15 +8,19 @@ addons: packages: - zlib1g-dev - libqt4-opengl-dev - - g++-4.8 - python3 - python-pip - python3-pip compiler: - clang env: - - py=python2 - - py=python3 + - py=python2 test=sphinx + - py=python3 test=sphinx + - py=null test=memalign + - py=python2 test=pylint + - py=python3 test=pylint + - py=python2 test=build + - py=python3 test=build install: - export NUMBER_OF_PROCESSORS=4 - export PATH=`pwd`/bin:${PATH} @@ -27,17 +31,27 @@ install: - pip install --user pylint recommonmark sphinx sphinx-rtd-theme - pip3 install --user pylint recommonmark sphinx sphinx-rtd-theme script: - - ${py} -m sphinx -n -N -W -w sphinx.log -c docs/ docs/ tmp/ - - ./check_memalign && $py ./configure -assert && $py ./build -nowarnings && ./run_tests - - PYTHON=$py ./run_pylint - - ./docs/generate_user_docs.sh && git diff --exit-code docs/ > gitdiff.log || echo "Documentation is not up to date; run docs/generate_user_docs.sh and commit changes" + - if [ ${test} = "sphinx" ]; then + ${py} -m sphinx -n -N -W -w sphinx.log -c docs/ docs/ tmp/ || travis_terminate 1; + elif [ ${test} = "memalign" ]; then + ./check_memalign || travis_terminate 1; + elif [ ${test} = "pylint" ]; then + PYTHON=$py ./run_pylint || travis_terminate 1; + else + $py ./configure -assert && $py ./build -nowarnings && ./run_tests || travis_terminate 1; + ./docs/generate_user_docs.sh && git diff --exit-code docs/ > gitdiff.log || travis_terminate 1; + fi after_failure: - - cat sphinx.log - - cat memalign.log - - cat configure.log - - cat build.log - - cat pylint.log - - cat testing.log - - cat pylint.log - - cat gitdiff.log + - if [ ${test} = "sphinx" ]; then + cat sphinx.log; + elif [ ${test} = "memalign" ]; then + cat memalign.log; + elif [ ${test} = "pylint" ]; then + cat pylint.log; + else + cat configure.log; + cat build.log; + cat testing.log; + cat gitdiff.log; + fi - sleep 10 From c7f4a7c831541cb3f187d7aaac9d77e3acf9e9db Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 26 Oct 2017 00:57:28 +1100 Subject: [PATCH 204/538] More playing with TravisCI build matrix By using an if statement within .travis.yml, return codes of test scripts would normally be ignored. A proposed solution to this was to trail each test with " || travis_terminate 1". Unfortunately this applies a hard termination, and the "after_failure" section of .travis.yml (containing the details of any errors) could not be accessed. This change moves the test branching into a dedicated script, travis.sh, which is configured to error out whenever any command executed returns an error code. --- .travis.yml | 11 +---------- travis.sh | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 travis.sh diff --git a/.travis.yml b/.travis.yml index 938951ae6e..8847ac387e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,16 +31,7 @@ install: - pip install --user pylint recommonmark sphinx sphinx-rtd-theme - pip3 install --user pylint recommonmark sphinx sphinx-rtd-theme script: - - if [ ${test} = "sphinx" ]; then - ${py} -m sphinx -n -N -W -w sphinx.log -c docs/ docs/ tmp/ || travis_terminate 1; - elif [ ${test} = "memalign" ]; then - ./check_memalign || travis_terminate 1; - elif [ ${test} = "pylint" ]; then - PYTHON=$py ./run_pylint || travis_terminate 1; - else - $py ./configure -assert && $py ./build -nowarnings && ./run_tests || travis_terminate 1; - ./docs/generate_user_docs.sh && git diff --exit-code docs/ > gitdiff.log || travis_terminate 1; - fi + - ./travis.sh after_failure: - if [ ${test} = "sphinx" ]; then cat sphinx.log; diff --git a/travis.sh b/travis.sh new file mode 100644 index 0000000000..e24d4a6f4d --- /dev/null +++ b/travis.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -ev + +# Script expects environment variables ${py} and ${test} to be set + +if [ ${test} = "sphinx" ]; then + $py -m sphinx -n -N -W -w sphinx.log -c docs/ docs/ tmp/; +elif [ ${test} = "memalign" ]; then + ./check_memalign; +elif [ ${test} = "pylint" ]; then + # Normally rely on build script to create this file + echo "__version__ = pylint_testing" > ./lib/mrtrix3/_version.py + PYTHON=$py ./run_pylint; +else + $py ./configure -assert && $py ./build -nowarnings && ./run_tests; + ./docs/generate_user_docs.sh && git diff --exit-code docs/ > gitdiff.log; +fi + +exit 0 From 1a4967614316b7e3d1cab93dec9adebad6f9e22e Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 26 Oct 2017 01:02:40 +1100 Subject: [PATCH 205/538] Make new script travis.sh executable --- travis.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 travis.sh diff --git a/travis.sh b/travis.sh old mode 100644 new mode 100755 From 96644591749c1faa5e749fc2be9a8f659c700967 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 26 Oct 2017 10:33:42 +1100 Subject: [PATCH 206/538] Revert docs/reference/commands_list.rst Due to TravisCI running docs/generate_user_docs.sh and testing for reportable changes, the relative order of the tcksift and tcksift2 commands cannot be altered (even if the sort command orders these two commands differently on different OS's :-/ ) --- docs/reference/commands_list.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/commands_list.rst b/docs/reference/commands_list.rst index 72c668e989..2525cd621c 100644 --- a/docs/reference/commands_list.rst +++ b/docs/reference/commands_list.rst @@ -100,8 +100,8 @@ List of MRtrix3 commands commands/tcknormalise commands/tckresample commands/tcksample - commands/tcksift commands/tcksift2 + commands/tcksift commands/tckstats commands/tensor2metric commands/transformcalc @@ -213,8 +213,8 @@ List of MRtrix3 commands :ref:`tcknormalise`, "Apply a normalisation map to a tracks file" :ref:`tckresample`, "Resample each streamline in a track file to a new set of vertices" :ref:`tcksample`, "Sample values of an associated image along tracks" - :ref:`tcksift`, "Filter a whole-brain fibre-tracking data set such that the streamline densities match the FOD lobe integrals" :ref:`tcksift2`, "Successor to the SIFT method; instead of removing streamlines, use an EM framework to find an appropriate cross-section multiplier for each streamline" + :ref:`tcksift`, "Filter a whole-brain fibre-tracking data set such that the streamline densities match the FOD lobe integrals" :ref:`tckstats`, "Calculate statistics on streamlines length" :ref:`tensor2metric`, "Generate maps of tensor-derived parameters" :ref:`transformcalc`, "Perform calculations on linear transformation matrices" From 23ed311e64b1a7e8ac98b8359325e569b121ed1d Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 26 Oct 2017 13:32:54 +1100 Subject: [PATCH 207/538] More TravisCI experimentation - Try to use clang version 5.0, rather than the default 3.9. Try to include a test with gcc, but only run a single build test with a single version of Python, i.e. don't repeat every single test with both compilers. --- .travis.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8847ac387e..9c67131f71 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,14 +5,18 @@ addons: apt: sources: - ubuntu-toolchain-r-test + - llvm-toolchain-trusty-5.0 packages: + - gcc-8 + - clang-5.0 - zlib1g-dev - libqt4-opengl-dev - python3 - python-pip - python3-pip compiler: - - clang + - clang-5.0 + - gcc-8 env: - py=python2 test=sphinx - py=python3 test=sphinx @@ -30,6 +34,17 @@ install: - pip install urllib3[secure] - pip install --user pylint recommonmark sphinx sphinx-rtd-theme - pip3 install --user pylint recommonmark sphinx sphinx-rtd-theme +matrix: + exclude: + - compiler: gcc-8 + env: test=sphinx + - compiler: gcc-8 + env: test=memalign + - compiler: gcc-8 + env: test=pylint + - compiler: gcc-8 + env: py=python2 + env: test=build script: - ./travis.sh after_failure: From a569c84f083b9ffe4c45004bf72ddb942d035b41 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 26 Oct 2017 13:39:19 +1100 Subject: [PATCH 208/538] Attempt to fix TravisCI test gcc-8 could not be found; try gcc-7 instead. Move matrix exclusion to be directly below compiler and env settings, since it did not perform its duty previously when it was below the install directive. --- .travis.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9c67131f71..9486e564f9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ addons: - ubuntu-toolchain-r-test - llvm-toolchain-trusty-5.0 packages: - - gcc-8 + - gcc-7 - clang-5.0 - zlib1g-dev - libqt4-opengl-dev @@ -16,7 +16,7 @@ addons: - python3-pip compiler: - clang-5.0 - - gcc-8 + - gcc-7 env: - py=python2 test=sphinx - py=python3 test=sphinx @@ -25,6 +25,17 @@ env: - py=python3 test=pylint - py=python2 test=build - py=python3 test=build +matrix: + exclude: + - compiler: gcc-7 + env: test=sphinx + - compiler: gcc-7 + env: test=memalign + - compiler: gcc-7 + env: test=pylint + - compiler: gcc-7 + env: py=python2 + env: test=build install: - export NUMBER_OF_PROCESSORS=4 - export PATH=`pwd`/bin:${PATH} @@ -34,17 +45,6 @@ install: - pip install urllib3[secure] - pip install --user pylint recommonmark sphinx sphinx-rtd-theme - pip3 install --user pylint recommonmark sphinx sphinx-rtd-theme -matrix: - exclude: - - compiler: gcc-8 - env: test=sphinx - - compiler: gcc-8 - env: test=memalign - - compiler: gcc-8 - env: test=pylint - - compiler: gcc-8 - env: py=python2 - env: test=build script: - ./travis.sh after_failure: From 9c3eef31c1042028bb57617597b77e98dd35b7d7 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 26 Oct 2017 14:26:42 +1100 Subject: [PATCH 209/538] Try different approach for TravisCI setup - Use a list of tests to include, rather than trying to construct a full matrix and then exclude elements. Try only installing particular features if they are required for the test being performed. --- .travis.yml | 82 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 55 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9486e564f9..d6ec7a9fe7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,44 +7,72 @@ addons: - ubuntu-toolchain-r-test - llvm-toolchain-trusty-5.0 packages: - - gcc-7 + - g++-7 - clang-5.0 - zlib1g-dev - libqt4-opengl-dev - python3 - python-pip - python3-pip -compiler: - - clang-5.0 - - gcc-7 -env: - - py=python2 test=sphinx - - py=python3 test=sphinx - - py=null test=memalign - - py=python2 test=pylint - - py=python3 test=pylint - - py=python2 test=build - - py=python3 test=build matrix: - exclude: - - compiler: gcc-7 - env: test=sphinx - - compiler: gcc-7 - env: test=memalign - - compiler: gcc-7 - env: test=pylint - - compiler: gcc-7 - env: py=python2 - env: test=build + include: + ####################################################################### + # Generate documentation through Sphinx; Use both Python2 and Python3 # + ####################################################################### + - compiler: clang-5.0 + env: py=python2 test=sphinx + - compiler: clang-5.0 + env: py=python3 test=sphinx + ############################################################# + # Run the check_memalign script; only needs to be done once # + ############################################################# + - compiler: clang-5.0 + env: py= test=memalign + ############################################## + # Run PyLint tests; both Python2 and Python3 # + ############################################## + - compiler: clang-5.0 + env: py=python2 test=pylint + - compiler: clang-5.0 + env: py=python3 test=pylint + ################################################################################# + # Build binaries, run tests and check documentation: Clang, Python2 and Python3 # + ################################################################################# + - compiler: clang-5.0 + env: py=python2 test=build + - compiler: clang-5.0 + env: py=python3 test=build + ################################################################ + # Test build using GCC; no need to use both versions of Python # + ################################################################ + - compiler: g++-7 + env: py=python2 test=build install: - export NUMBER_OF_PROCESSORS=4 - export PATH=`pwd`/bin:${PATH} - export PYTHONPATH=`pwd`/lib:${PYTHONPATH} - - export EIGEN_CFLAGS=-I`pwd`/../eigen - - (cd ..; hg clone https://bitbucket.org/eigen/eigen/; cd eigen; hg update 3.3) - - pip install urllib3[secure] - - pip install --user pylint recommonmark sphinx sphinx-rtd-theme - - pip3 install --user pylint recommonmark sphinx sphinx-rtd-theme + - if [[ ${test} == "sphinx" ]]; then + if [[ ${py} == "python2" ]]; then + pip install urllib3[secure] + pip install --user recommonmark sphinx sphinx-rtd-theme + else + pip3 install --user recommonmark sphinx sphinx-rtd-theme + fi + fi + - if [[ ${test} == "pylint" ]]; then + if [[ ${py} == "python2" ]]; then + pip install --user pylint + else + pip3 install --user pylint + fi + fi + - if [[ "${test} == "build" ]]; then + export EIGEN_CFLAGS=-I`pwd`/../eigen + cd .. + hg clone https://bitbucket.org/eigen/eigen/ + cd eigen + hg update 3.3 + fi script: - ./travis.sh after_failure: From a60a50f7f8a100425fd9dec1b4c4e72c25898ba6 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 26 Oct 2017 14:43:53 +1100 Subject: [PATCH 210/538] Try to fix branching in TravisCI setup --- .travis.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index d6ec7a9fe7..c0b3bfd85c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,22 +51,22 @@ install: - export NUMBER_OF_PROCESSORS=4 - export PATH=`pwd`/bin:${PATH} - export PYTHONPATH=`pwd`/lib:${PYTHONPATH} - - if [[ ${test} == "sphinx" ]]; then - if [[ ${py} == "python2" ]]; then + - if [[ "${test}" == "sphinx" ]]; then + if [[ "${py}" == "python2" ]]; then pip install urllib3[secure] pip install --user recommonmark sphinx sphinx-rtd-theme else pip3 install --user recommonmark sphinx sphinx-rtd-theme fi fi - - if [[ ${test} == "pylint" ]]; then - if [[ ${py} == "python2" ]]; then + - if [[ "${test}" == "pylint" ]]; then + if [[ "${py}" == "python2" ]]; then pip install --user pylint else pip3 install --user pylint fi fi - - if [[ "${test} == "build" ]]; then + - if [[ "${test}" == "build" ]]; then export EIGEN_CFLAGS=-I`pwd`/../eigen cd .. hg clone https://bitbucket.org/eigen/eigen/ @@ -76,11 +76,11 @@ install: script: - ./travis.sh after_failure: - - if [ ${test} = "sphinx" ]; then + - if [[ "${test}" == "sphinx" ]]; then cat sphinx.log; - elif [ ${test} = "memalign" ]; then + elif [[ "${test}" == "memalign" ]]; then cat memalign.log; - elif [ ${test} = "pylint" ]; then + elif [[ "${test}" == "pylint" ]]; then cat pylint.log; else cat configure.log; From 809eff752941bc2e2ae897bab5f6fb72ed5b2736 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 26 Oct 2017 15:03:05 +1100 Subject: [PATCH 211/538] Trying to prevent TravisCI error at first installation branch /home/travis/.travis/job_stages: eval: line 58: syntax error: unexpected end of file --- .travis.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index c0b3bfd85c..a70744f1fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,32 +51,33 @@ install: - export NUMBER_OF_PROCESSORS=4 - export PATH=`pwd`/bin:${PATH} - export PYTHONPATH=`pwd`/lib:${PYTHONPATH} - - if [[ "${test}" == "sphinx" ]]; then + - | + if [[ "${test}" == "sphinx" ]]; then if [[ "${py}" == "python2" ]]; then - pip install urllib3[secure] - pip install --user recommonmark sphinx sphinx-rtd-theme + pip install urllib3[secure]; + pip install --user recommonmark sphinx sphinx-rtd-theme; else - pip3 install --user recommonmark sphinx sphinx-rtd-theme + pip3 install --user recommonmark sphinx sphinx-rtd-theme; fi fi - - if [[ "${test}" == "pylint" ]]; then + - | + if [[ "${test}" == "pylint" ]]; then if [[ "${py}" == "python2" ]]; then - pip install --user pylint + pip install --user pylint; else - pip3 install --user pylint + pip3 install --user pylint; fi fi - - if [[ "${test}" == "build" ]]; then - export EIGEN_CFLAGS=-I`pwd`/../eigen - cd .. - hg clone https://bitbucket.org/eigen/eigen/ - cd eigen - hg update 3.3 + - | + if [[ "${test}" == "build" ]]; then + export EIGEN_CFLAGS=-I`pwd`/../eigen; + (cd ..; hg clone https://bitbucket.org/eigen/eigen/; cd eigen; hg update 3.3); fi script: - ./travis.sh after_failure: - - if [[ "${test}" == "sphinx" ]]; then + - | + if [[ "${test}" == "sphinx" ]]; then cat sphinx.log; elif [[ "${test}" == "memalign" ]]; then cat memalign.log; From 97a245c11ff691f53192d71689cd4e5aae4dffc9 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 26 Oct 2017 15:25:35 +1100 Subject: [PATCH 212/538] TravisCI: Try manually setting compiler While the "compiler:" flag can be used in .travis.yml, this appears to hard-code environment variables CC and CXX to the "default" compiler paths, i.e. g++ and clang++, rather than the paths to the newer versions of those compilers actually installed. As a consequence, while TravisCI reports the newer compiler version in its GUI and queries the version of the compiler during initialisation, MRtrix3 doesn't actually see them. So here, I'm instead avoiding the "compiler:" directive altogether, and just setting CXX myself. --- .travis.yml | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index a70744f1fc..bebd4f418c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,34 +19,26 @@ matrix: ####################################################################### # Generate documentation through Sphinx; Use both Python2 and Python3 # ####################################################################### - - compiler: clang-5.0 - env: py=python2 test=sphinx - - compiler: clang-5.0 - env: py=python3 test=sphinx + - env: py=python2 test=sphinx + - env: py=python3 test=sphinx ############################################################# # Run the check_memalign script; only needs to be done once # ############################################################# - - compiler: clang-5.0 - env: py= test=memalign + - env: test=memalign ############################################## # Run PyLint tests; both Python2 and Python3 # ############################################## - - compiler: clang-5.0 - env: py=python2 test=pylint - - compiler: clang-5.0 - env: py=python3 test=pylint + - env: py=python2 test=pylint + - env: py=python3 test=pylint ################################################################################# # Build binaries, run tests and check documentation: Clang, Python2 and Python3 # ################################################################################# - - compiler: clang-5.0 - env: py=python2 test=build - - compiler: clang-5.0 - env: py=python3 test=build + - env: CXX=clang++-5.0 py=python2 test=build + - env: CXX=clang++-5.0 py=python3 test=build ################################################################ # Test build using GCC; no need to use both versions of Python # ################################################################ - - compiler: g++-7 - env: py=python2 test=build + - env: CXX=g++-7 py=python2 test=build install: - export NUMBER_OF_PROCESSORS=4 - export PATH=`pwd`/bin:${PATH} From 2922dd028f24b7301eff1d24eafe47c4c12a978f Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 26 Oct 2017 15:51:52 +1100 Subject: [PATCH 213/538] TravisCI: More changes - Try enabling caching of apt and pip installs. Since TravisCI set the CXX environment variable to whatever it thinks it is supposed to be (even if the "compiler:" directive is not used), it is necessary to wait until after TravisCI has set CXX and then set it back to what we want. --- .travis.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index bebd4f418c..2e2117e4b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,11 @@ sudo: false dist: trusty language: cpp +cache: + apt: true + directories: + - $HOME/.cache/pip + - $HOME/.cache/pip3 addons: apt: sources: @@ -33,12 +38,20 @@ matrix: ################################################################################# # Build binaries, run tests and check documentation: Clang, Python2 and Python3 # ################################################################################# - - env: CXX=clang++-5.0 py=python2 test=build - - env: CXX=clang++-5.0 py=python3 test=build + - env: TRAVIS_CXX=clang++-5.0 py=python2 test=build + - env: TRAVIS_CXX=clang++-5.0 py=python3 test=build ################################################################ # Test build using GCC; no need to use both versions of Python # ################################################################ - - env: CXX=g++-7 py=python2 test=build + - env: TRAVIS_CXX=g++-7 py=python2 test=build +before_install: + ##################################################################################################################### + # TravisCI sets CXX based on what it thinks the compiler should be; therefore we need to set it as late as possible # + ##################################################################################################################### + - | + if [[ -v TRAVIS_CXX ]]; then + export CXX=${TRAVIS_CXX} + fi install: - export NUMBER_OF_PROCESSORS=4 - export PATH=`pwd`/bin:${PATH} From 811c026313bc69d10adbadd8aa53af65be7d1a27 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 26 Oct 2017 17:05:14 +1100 Subject: [PATCH 214/538] TravisCI: Disable g++ tests, and tweak cache --- .travis.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2e2117e4b8..2b91fbe95d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,16 +3,19 @@ dist: trusty language: cpp cache: apt: true + packages: true directories: - $HOME/.cache/pip - - $HOME/.cache/pip3 addons: apt: sources: - ubuntu-toolchain-r-test - llvm-toolchain-trusty-5.0 packages: - - g++-7 + ###################################################################### + # G++ currently disabled as it runs out of memory during compilation # + # - g++-7 # + ###################################################################### - clang-5.0 - zlib1g-dev - libqt4-opengl-dev @@ -42,8 +45,10 @@ matrix: - env: TRAVIS_CXX=clang++-5.0 py=python3 test=build ################################################################ # Test build using GCC; no need to use both versions of Python # + # - env: TRAVIS_CXX=g++-7 py=python2 test=build # + # Disabled for now: g++ runs out of memory... # ################################################################ - - env: TRAVIS_CXX=g++-7 py=python2 test=build + before_install: ##################################################################################################################### # TravisCI sets CXX based on what it thinks the compiler should be; therefore we need to set it as late as possible # @@ -80,6 +85,8 @@ install: fi script: - ./travis.sh +before_cache: + - rm -f $HOME/.cache/pip/log/debug.log after_failure: - | if [[ "${test}" == "sphinx" ]]; then From e09f7cfdca1e5aeccc652afab27a2264e0f6d748 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Thu, 26 Oct 2017 16:57:38 +0100 Subject: [PATCH 215/538] dirstat: ignore b=0 shell, and improve output interface --- cmd/dirstat.cpp | 346 ++++++++++++++++++++++++------------------------ 1 file changed, 170 insertions(+), 176 deletions(-) diff --git a/cmd/dirstat.cpp b/cmd/dirstat.cpp index 10e907f96e..2bfc0d716d 100644 --- a/cmd/dirstat.cpp +++ b/cmd/dirstat.cpp @@ -30,22 +30,47 @@ void usage () SYNOPSIS = "Report statistics on a direction set"; + DESCRIPTION + + "This command will accept as inputs:" + + "- directions file in spherical coordinates (ASCII text, [ az el ] space-separated values, one per line);" + + "- directions file in Cartesian coordinates (ASCII text, [ x y z ] space-separated values, one per line);" + + "- DW gradient files (MRtrix format: ASCII text, [ x y z b ] space-separated values, one per line);" + + "- image files, using the DW gradient scheme found in the header (or provided using the appropriate command line options below)." + + + "By default, this produces all relevant metrics for the direction set " + "provided. If the direction set contains multiple shells, metrics are " + "provided for each shell separately." + + + "Metrics are produced assuming a unipolar or bipolar electrostatic " + "repulsion model, producing the potential energy (total, mean, min & max), " + "and the nearest-neighbour angles (mean, min & max). The condition " + "number is also produced for the spherical harmonic fits up to the highest " + "harmonic order supported by the number of volumes. Finally, the norm of the " + "mean direction vector is provided as a measure of the overall symmetry of " + "the direction set (important with respect to eddy-current resilience)." + + + "Specific metrics can also be queried independently via the \"-output\" " + "option, using these shorthands: U/B for unipolar/bipolar model, E/N " + "for energy and nearest-neighbour respectively, t/-/+ for total/min/max " + "respectively (mean implied otherwise); SHn for condition number of SH fit " + "at order n (with n an even integer); SYM for symmetry index (norm of " + "mean direction vector); and N for the number of directions. For example:" + + "-output BN,BN-,BN+ requests the mean, min and max nearest-neighour " + "angles assuming a bipolar model." + + "-output UE,SH8,SYM requests the mean unipolar electrostatic energy, " + "condition number of SH fit at order 8, and the symmetry index."; + ARGUMENTS + Argument ("dirs", "the text file or image containing the directions.").type_file_in(); OPTIONS - + OptionGroup ("Output options") - + Option ("bipolar", "output statistics for bipolar electrostatic repulsion model") - + Option ("unipolar", "output statistics for unipolar electrostatic repulsion model") - + Option ("shfit", "output statistics for spherical harmonics fit") - + Option ("symmetry", "output measure of symmetry of spherical coverage (as given by the norm of mean direction vector). This is important to ensure minimal bias due to eddy-currents.") - + Option ("nearest_neighour", "output nearest-neighbour angle statistics") - + Option ("energy", "output energy statistics") - + Option ("total", "output total of statistic (affects -energy only)") - + Option ("mean", "output mean of statistic (affects -nearest_neighbour or -energy only)") - + Option ("range", "output range of statistic (affects -nearest_neighbour or -energy only)") - + DWI::GradImportOptions() - + DWI::ShellsOption; + + Option ("output", "output selected metrics as a space-delimited list, " + "suitable for use in scripts. This will produce one line of values per " + "selected shell. Valid metrics are as specified in the description " + "above.") + + Argument ("list") + + DWI::ShellsOption + + DWI::GradImportOptions(); } @@ -54,40 +79,10 @@ int precision = 6; void report (const std::string& title, Eigen::MatrixXd& directions); -bool bipolar = false; -bool unipolar = false; -bool shfit = false; -bool nearest_neighour = false; -bool energy = false; -bool symmetry = false; -bool total = false; -bool mean = false; -bool range = false; - void run () { - bipolar = get_options ("bipolar").size(); - unipolar = get_options ("unipolar").size(); - shfit = get_options ("shfit").size(); - symmetry = get_options ("symmetry").size(); - nearest_neighour = get_options ("nearest_neighour").size(); - energy = get_options ("energy").size(); - total = get_options ("total").size(); - mean = get_options ("mean").size(); - range = get_options ("range").size(); - - - if (!(bipolar | unipolar | shfit | symmetry)) - bipolar = unipolar = shfit = symmetry = true; - - if (!(nearest_neighour | energy)) - nearest_neighour = energy = true; - - if (!(total | mean | range)) - total = mean = range = true; - Eigen::MatrixXd directions; try { @@ -104,10 +99,18 @@ void run () } if (directions.cols() >= 4) { + int n_start = 0; auto shells = DWI::Shells (directions).select_shells (false, false, false); + if (get_options ("shells").empty() && shells.has_bzero() && shells.count() > 1) { + n_start = 1; + if (get_options("output").empty()) + print (std::string (argument[0]) + " (b=0) [ " + str(shells.smallest().count(), precision) + " volumes ]\n\n"); + } + + Eigen::MatrixXd dirs; - for (size_t n = 0; n < shells.count(); ++n) { + for (size_t n = n_start; n < shells.count(); ++n) { dirs.resize (shells[n].count(), 3); for (size_t idx = 0; idx < shells[n].count(); ++idx) dirs.row (idx) = directions.row (shells[n].get_volumes()[idx]).head (3); @@ -124,7 +127,21 @@ void run () +vector summarise_NN (const vector& NN) +{ + double NN_min = std::numeric_limits::max(); + double NN_mean = 0.0; + double NN_max = 0.0; + for (auto a : NN) { + a = (180.0/Math::pi) * std::acos (a); + NN_mean += a; + NN_min = std::min (NN_min, a); + NN_max = std::max (NN_max, a); + } + NN_mean /= NN.size(); + return { NN_mean, NN_min, NN_max }; +} @@ -132,177 +149,154 @@ void run () -void report (const std::string& title, Eigen::MatrixXd& directions) +vector summarise_E (const vector& E) { - if (directions.cols() < 3) - throw Exception ("unexpected matrix size for DW scheme \"" + str(argument[0]) + "\""); - DWI::normalise_grad (directions); - - if (log_level) - print (title + " [ " + str(directions.rows(), precision) + " directions ]\n"); - - - if ((bipolar | unipolar) && (energy | nearest_neighour)) { - vector NN_bipolar (directions.rows(), -1.0); - vector NN_unipolar (directions.rows(), -1.0); + double E_min = std::numeric_limits::max(); + double E_total = 0.0; + double E_max = 0.0; + for (auto e : E) { + E_total += e; + E_min = std::min (E_min, e); + E_max = std::max (E_max, e); + } - vector E_bipolar (directions.rows(), 0.0); - vector E_unipolar (directions.rows(), 0.0); + return { 0.5*E_total, E_total/E.size(), E_min, E_max }; +} - for (ssize_t i = 0; i < directions.rows()-1; ++i) { - for (ssize_t j = i+1; j < directions.rows(); ++j) { - double cos_angle = directions.row(i).head(3).normalized().dot (directions.row(j).head(3).normalized()); - NN_unipolar[i] = std::max (NN_unipolar[i], cos_angle); - NN_unipolar[j] = std::max (NN_unipolar[j], cos_angle); - cos_angle = std::abs (cos_angle); - NN_bipolar[i] = std::max (NN_bipolar[i], cos_angle); - NN_bipolar[j] = std::max (NN_bipolar[j], cos_angle); - double E = 1.0 / (directions.row(i).head(3) - directions.row(j).head(3)).norm(); - E_unipolar[i] += E; - E_unipolar[j] += E; +class Metrics { + public: + vector BN, UN, BE, UE, SH; + default_type SYM; + size_t ndirs; +}; - E += 1.0 / (directions.row(i).head(3) + directions.row(j).head(3)).norm(); - E_bipolar[i] += E; - E_bipolar[j] += E; - } - } +Metrics compute (Eigen::MatrixXd& directions) +{ + if (directions.cols() < 3) + throw Exception ("unexpected matrix size for scheme \"" + str(argument[0]) + "\""); + DWI::normalise_grad (directions); - auto report_NN = [](const vector& NN) { - double NN_min = std::numeric_limits::max(); - double NN_mean = 0.0; - double NN_max = 0.0; - for (auto a : NN) { - a = (180.0/Math::pi) * std::acos (a); - NN_mean += a; - NN_min = std::min (NN_min, a); - NN_max = std::max (NN_max, a); - } - NN_mean /= NN.size(); + vector NN_bipolar (directions.rows(), -1.0); + vector NN_unipolar (directions.rows(), -1.0); - std::string output; + vector E_bipolar (directions.rows(), 0.0); + vector E_unipolar (directions.rows(), 0.0); - if (log_level) - output = " nearest-neighbour angles: "; + for (ssize_t i = 0; i < directions.rows()-1; ++i) { + for (ssize_t j = i+1; j < directions.rows(); ++j) { + double cos_angle = directions.row(i).head(3).normalized().dot (directions.row(j).head(3).normalized()); + NN_unipolar[i] = std::max (NN_unipolar[i], cos_angle); + NN_unipolar[j] = std::max (NN_unipolar[j], cos_angle); + cos_angle = std::abs (cos_angle); + NN_bipolar[i] = std::max (NN_bipolar[i], cos_angle); + NN_bipolar[j] = std::max (NN_bipolar[j], cos_angle); - if (mean) { - if (log_level) - output += "mean = "; - output += str(NN_mean, precision); - } + double E = 1.0 / (directions.row(i).head(3) - directions.row(j).head(3)).norm(); - if (range) { - if (mean) - output += log_level ? ", " : " "; - if (log_level) - output += "range [ " + str(NN_min, precision) + " - " + str(NN_max, precision) + " ]"; - else - output += str(NN_min, precision) + " " + str(NN_max, precision); - } + E_unipolar[i] += E; + E_unipolar[j] += E; - if (output.size()) - print (output + "\n"); - }; + E += 1.0 / (directions.row(i).head(3) + directions.row(j).head(3)).norm(); + E_bipolar[i] += E; + E_bipolar[j] += E; + } + } - auto report_E = [](const vector& E) { - double E_min = std::numeric_limits::max(); - double E_total = 0.0; - double E_max = 0.0; - for (auto e : E) { - E_total += e; - E_min = std::min (E_min, e); - E_max = std::max (E_max, e); - } + Metrics metrics; + metrics.ndirs = directions.rows(); + metrics.UN = summarise_NN (NN_unipolar); + metrics.BN = summarise_NN (NN_bipolar); + metrics.UE = summarise_E (E_unipolar); + metrics.BE = summarise_E (E_bipolar); + for (size_t lmax = 2; lmax <= Math::SH::LforN (directions.rows()); lmax += 2) + metrics.SH.push_back (DWI::condition_number_for_lmax (directions, lmax)); - std::string output; + metrics.SYM = directions.leftCols(3).colwise().mean().norm(); - if (log_level) - output = " energy: "; + return metrics; +} - if (total) { - if (log_level) - output += "total = "; - output += str(0.5*E_total, precision); - } - if (mean) { - if (total) - output += log_level ? ", " : " "; - if (log_level) - output += "mean = "; - output += str(E_total/E.size(), precision); - } - if (range) { - if (mean | total) - output += log_level ? ", " : " "; - if (log_level) - output += "range [ " + str(E_min, precision) + " - " + str(E_max, precision) + " ]"; - else - output += str(E_min, precision) + " " + str(E_max, precision); - } - if (output.size()) - print (output + "\n"); - }; +void output_selected (const Metrics& metrics, const std::string& selection) +{ + auto select = split (selection, ", \t\n", true); + + for (const auto& x : select) { + if (x == "UEt") std::cout << metrics.UE[0] << " "; + else if (x == "UE") std::cout << metrics.UE[1] << " "; + else if (x == "UE-") std::cout << metrics.UE[2] << " "; + else if (x == "UE+") std::cout << metrics.UE[3] << " "; + else if (x == "BEt") std::cout << metrics.BE[0] << " "; + else if (x == "BE") std::cout << metrics.BE[1] << " "; + else if (x == "BE-") std::cout << metrics.BE[2] << " "; + else if (x == "BE+") std::cout << metrics.BE[3] << " "; + else if (x == "UN") std::cout << metrics.UN[0] << " "; + else if (x == "UN-") std::cout << metrics.UN[1] << " "; + else if (x == "UN+") std::cout << metrics.UN[2] << " "; + else if (x == "BN") std::cout << metrics.BN[0] << " "; + else if (x == "BN-") std::cout << metrics.BN[1] << " "; + else if (x == "BN+") std::cout << metrics.BN[2] << " "; + else if (x == "SYM") std::cout << metrics.SYM << " "; + else if (x == "N") std::cout << metrics.ndirs << " "; + else if (x.substr(0,2) == "SH") { + size_t order = to(x.substr(2)); + if (order & 1U || order < 2) + throw Exception ("spherical harmonic order must be an even positive integer"); + order = (order/2)-1; + if (order >= metrics.SH.size()) + throw Exception ("spherical harmonic order requested is too large given number of directions"); + std::cout << metrics.SH[order] << " "; + } + else + throw Exception ("unknown output specifier \"" + x + "\""); + } + std::cout << "\n"; +} +void report (const std::string& title, Eigen::MatrixXd& directions) +{ + auto metrics = compute (directions); + auto opt = get_options ("output"); + if (opt.size()) { + output_selected (metrics, opt[0][0]); + return; + } - if (bipolar) { - if (log_level) - print ("\n Bipolar electrostatic repulsion model:\n"); - if (nearest_neighour) - report_NN (NN_bipolar); - if (energy) - report_E (E_bipolar); - } + std::string output = title + " [ " + str(metrics.ndirs, precision) + " directions ]\n"; - if (unipolar) { - if (log_level) - print ("\n Unipolar electrostatic repulsion model:\n"); - if (nearest_neighour) - report_NN (NN_unipolar); - if (energy) - report_E (E_unipolar); - } + output += "\n Bipolar electrostatic repulsion model:\n"; + output += " nearest-neighbour angles: mean = " + str(metrics.BN[0], precision) + ", range [ " + str(metrics.BN[1], precision) + " - " + str(metrics.BN[2], precision) + " ]\n"; + output += " energy: total = " + str(metrics.BE[0], precision) + ", mean = " + str(metrics.BE[1], precision) + ", range [ " + str(metrics.BE[2], precision) + " - " + str(metrics.BE[3], precision) + " ]\n"; - } + output += "\n Unipolar electrostatic repulsion model:\n"; + output += " nearest-neighbour angles: mean = " + str(metrics.UN[0], precision) + ", range [ " + str(metrics.UN[1], precision) + " - " + str(metrics.UN[2], precision) + " ]\n"; + output += " energy: total = " + str(metrics.UE[0], precision) + ", mean = " + str(metrics.UE[1], precision) + ", range [ " + str(metrics.UE[2], precision) + " - " + str(metrics.UE[3], precision) + " ]\n"; - if (shfit) { - std::string lmax_results; - for (size_t lmax = 2; lmax <= Math::SH::LforN (directions.rows()); lmax += 2) - lmax_results += str(DWI::condition_number_for_lmax (directions, lmax), precision) + " "; - if (log_level) - print ("\n Spherical Harmonic fit:\n condition numbers for lmax = " + str(2) + " -> " - + str(Math::SH::LforN (directions.rows()), precision) + ": "); - print (lmax_results + "\n"); - } + output += "\n Spherical Harmonic fit:\n condition numbers for lmax = 2 -> " + str(metrics.SH.size()*2) + ": " + str(metrics.SH, precision) + "\n"; - if (symmetry) { - if (log_level) - print ("\n Symmetry of sampling:\n norm of mean direction vector = "); - auto symmetry_index = directions.leftCols(3).colwise().mean().norm(); - print (str (symmetry_index, precision) + "\n"); - if (log_level && symmetry_index >= 0.1) - print (std::string (" WARNING: sampling is ") + ( symmetry_index >= 0.4 ? "strongly" : "moderately" ) - + " asymmetric - this may affect resiliance to eddy-current distortions"); - } + output += "\n Symmetry of sampling:\n norm of mean direction vector = " + str(metrics.SYM, precision) + "\n"; + if (metrics.SYM >= 0.1) + output += std::string(" WARNING: sampling is ") + ( metrics.SYM >= 0.4 ? "strongly" : "moderately" ) + + " asymmetric - this may affect resiliance to eddy-current distortions\n"; - if (log_level) - print ("\n"); + output += "\n"; + print (output); } - From d05840845cf7b3fc12ef6ddde1994699441e3db1 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 31 Oct 2017 09:38:03 +1100 Subject: [PATCH 216/538] TravisCI: Initiate longest job first --- .travis.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 27423b4133..dd25b26e62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,11 @@ addons: - python3-pip matrix: include: + ##################################################################### + # Build binaries, run tests and check documentation: Clang, Python3 # + # (Note: Run this one first, since it'll be the longest job) # + ##################################################################### + - env: TRAVIS_CXX=clang++-5.0 py=python3 test=run ####################################################################### # Generate documentation through Sphinx; Use both Python2 and Python3 # ####################################################################### @@ -43,10 +48,6 @@ matrix: ############################################################### - env: TRAVIS_CXX=g++-5.0 py=python2 test=build - env: TRAVIS_CXX=clang++-5.0 py=python2 test=build - ##################################################################### - # Build binaries, run tests and check documentation: Clang, Python3 # - ##################################################################### - - env: TRAVIS_CXX=clang++-5.0 py=python3 test=run before_install: ##################################################################################################################### From e010b75960beec37f35996ef5654eed2dc3fdd3e Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 31 Oct 2017 10:20:25 +1100 Subject: [PATCH 217/538] TravisCI: Fix g++7 and Eigen3 installations --- .travis.yml | 16 ++++++---------- travis.sh | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index dd25b26e62..a4774a52d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,10 +12,7 @@ addons: - ubuntu-toolchain-r-test - llvm-toolchain-trusty-5.0 packages: - ###################################################################### - # G++ currently disabled as it runs out of memory during compilation # - # - g++-7 # - ###################################################################### + - g++-7 - clang-5.0 - zlib1g-dev - libqt4-opengl-dev @@ -43,11 +40,10 @@ matrix: ############################################## - env: py=python2 test=pylint - env: py=python3 test=pylint - ############################################################### - # Build binaries (without optimisation): Clang & GCC, Python2 # - ############################################################### - - env: TRAVIS_CXX=g++-5.0 py=python2 test=build - - env: TRAVIS_CXX=clang++-5.0 py=python2 test=build + ####################################################### + # Build binaries (without optimisation): GCC, Python2 # + ####################################################### + - env: TRAVIS_CXX=g++-7.0 py=python2 test=build before_install: ##################################################################################################################### @@ -79,7 +75,7 @@ install: fi fi - | - if [[ "${test}" == "build" ]]; then + if [[ "${test}" == "build" || "${test}" == "run" ]]; then export EIGEN_CFLAGS=-I`pwd`/../eigen; (cd ..; hg clone https://bitbucket.org/eigen/eigen/; cd eigen; hg update 3.3); fi diff --git a/travis.sh b/travis.sh index ede98be358..404e808f2c 100755 --- a/travis.sh +++ b/travis.sh @@ -13,7 +13,7 @@ elif [ ${test} = "pylint" ]; then echo "__version__ = pylint_testing" > ./lib/mrtrix3/_version.py; PYTHON=$py ./run_pylint; elif [ ${test} = "build" ]; then - $py ./configure -assert -nooptim && $py ./build -nowarnings; + $py ./configure -nooptim && $py ./build -nowarnings; elif [ ${test} = "run" ]; then $py ./configure -assert && $py ./build -nowarnings && ./run_tests; ./docs/generate_user_docs.sh && git diff --exit-code docs/ > gitdiff.log; From bb6a29d60dc5daaf34ca606d7a044b6758952ae2 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 31 Oct 2017 11:04:06 +1100 Subject: [PATCH 218/538] TravisCI fixes - Fix path to g++ 7 binary. - For full run test, place all tests on a single line separated by and operators, and remove the trailing "exit 0" call, so that failures should be flagged as such. --- .travis.yml | 2 +- travis.sh | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index a4774a52d7..40b984fa93 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,7 +43,7 @@ matrix: ####################################################### # Build binaries (without optimisation): GCC, Python2 # ####################################################### - - env: TRAVIS_CXX=g++-7.0 py=python2 test=build + - env: TRAVIS_CXX=g++-7 py=python2 test=build before_install: ##################################################################################################################### diff --git a/travis.sh b/travis.sh index 404e808f2c..efdf4e4dcf 100755 --- a/travis.sh +++ b/travis.sh @@ -15,11 +15,8 @@ elif [ ${test} = "pylint" ]; then elif [ ${test} = "build" ]; then $py ./configure -nooptim && $py ./build -nowarnings; elif [ ${test} = "run" ]; then - $py ./configure -assert && $py ./build -nowarnings && ./run_tests; - ./docs/generate_user_docs.sh && git diff --exit-code docs/ > gitdiff.log; + $py ./configure -assert && $py ./build -nowarnings && ./run_tests && ./docs/generate_user_docs.sh && git diff --exit-code docs/ > gitdiff.log; else echo "Envvar \"test\" not defined"; exit 1 fi - -exit 0 From 549e49550bf534f5af14b1f4d2ee0b09ebcd5c86 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 31 Oct 2017 17:07:11 +1100 Subject: [PATCH 219/538] Fixes for TravisCI testing. - Run g++ non-optimised compilation as second job, since it's likely to be the second-longest job. - Prevent g++ compilation error due to failure to inline a function, where that failure occurs due to that function being recursive and the compiler has been instructed to not optimise (dirgen appears to have been the only instance of this occurring). - Fix comparison between signed and unsigned integers in DICOM code. --- .travis.yml | 10 +++++----- cmd/dirgen.cpp | 6 +++++- core/file/dicom/mapper.cpp | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 40b984fa93..5b4ffa2c0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,11 @@ matrix: ##################################################################### - env: TRAVIS_CXX=clang++-5.0 py=python3 test=run ####################################################################### + # Build binaries (without optimisation): GCC, Python2 # + # (Also ensures both Python 2 and 3 are tested for configure & build) # + ####################################################################### + - env: TRAVIS_CXX=g++-7 py=python2 test=build + ####################################################################### # Generate documentation through Sphinx; Use both Python2 and Python3 # ####################################################################### - env: py=python2 test=sphinx @@ -40,11 +45,6 @@ matrix: ############################################## - env: py=python2 test=pylint - env: py=python3 test=pylint - ####################################################### - # Build binaries (without optimisation): GCC, Python2 # - ####################################################### - - env: TRAVIS_CXX=g++-7 py=python2 test=build - before_install: ##################################################################################################################### # TravisCI sets CXX based on what it thinks the compiler should be; therefore we need to set it as late as possible # diff --git a/cmd/dirgen.cpp b/cmd/dirgen.cpp index 88d69e0e32..3fa6bc21d9 100644 --- a/cmd/dirgen.cpp +++ b/cmd/dirgen.cpp @@ -105,7 +105,11 @@ class Energy { MEMALIGN(Energy) power (0), directions (3 * ndirs) { } - FORCE_INLINE double fast_pow (double x, int p) { +// Non-optimised compilation can't handle recursive inline functions +#ifdef __OPTIMIZE__ +FORCE_INLINE +#endif + double fast_pow (double x, int p) { return p == 1 ? x : fast_pow (x*x, p/2); } diff --git a/core/file/dicom/mapper.cpp b/core/file/dicom/mapper.cpp index bef1b7b8c6..4124ad1f06 100644 --- a/core/file/dicom/mapper.cpp +++ b/core/file/dicom/mapper.cpp @@ -215,7 +215,7 @@ namespace MR { H.size(1) = std::floor (frame.dim[1] / mosaic_size); H.size(2) = image.images_in_mosaic; - if (frame.acq_dim[0] > H.size(0) || frame.acq_dim[1] > H.size(1)) { + if (frame.acq_dim[0] > size_t(H.size(0)) || frame.acq_dim[1] > size_t(H.size(1))) { WARN ("acquisition matrix [ " + str (frame.acq_dim[0]) + " " + str (frame.acq_dim[1]) + " ] is smaller than expected [ " + str(H.size(0)) + " " + str(H.size(1)) + " ] in DICOM mosaic"); WARN (" image may be incorrectly reformatted"); @@ -228,7 +228,7 @@ namespace MR { WARN (" image may be incorrectly reformatted"); } - if (frame.acq_dim[0] != H.size(0)|| frame.acq_dim[1] != H.size(1)) + if (frame.acq_dim[0] != size_t(H.size(0)) || frame.acq_dim[1] != size_t(H.size(1))) INFO ("note: acquisition matrix [ " + str (frame.acq_dim[0]) + " " + str (frame.acq_dim[1]) + " ] differs from reconstructed matrix [ " + str(H.size(0)) + " " + str(H.size(1)) + " ]"); From 9f883e824cf5f7957e75628bb65f4342a19f5a04 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 1 Nov 2017 12:13:38 +1100 Subject: [PATCH 220/538] Changes for new dirstat enhancements - dwipreproc: Check the asymmetry of sampling of all b-nonzero shells, and give the user a warning and recommendation if their sampling scheme is asymmetric. - In dirstat, rename symmetry index to asymmetry index (since it is zero for a perfectly symmetric acquisition). - Allow inputs to dirstat -output option to be either uppercase or lowercase. - Regenerate documentation for dirstat. --- bin/dwipreproc | 18 +++++++ cmd/dirstat.cpp | 73 +++++++++++++++-------------- docs/reference/commands/dirstat.rst | 40 +++++++++------- 3 files changed, 77 insertions(+), 54 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 9574246600..22aa3b3dee 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -152,6 +152,24 @@ if not len(grad) == dwi_num_volumes: app.error('Number of lines in gradient table (' + str(len(grad)) + ') does not match input image (' + str(dwi_num_volumes) + ' volumes); check your input data') +# Use new features of dirstat to query the quality of the diffusion acquisition scheme +# Need to know the mean b-value in each shell, and the asymmetry value of each shell +# But don't bother testing / warning the user if they're already controlling for this +if not app.args.eddy_options or not any(s.startswith('--slm=') for s in app.args.eddy_options.split()): + shell_bvalues = [ int(round(float(value))) for value in image.mrinfo('dwi.mif', 'shellvalues').split() ] + shell_asymmetry = [ float(value) for value in run.command('dirstat dwi.mif -output asym')[0].splitlines() ] + # dirstat will skip any b=0 shell by default; therefore for correspondence between + # shell_bvalues and shell_symmetry, need to remove any b=0 from the former + if len(shell_bvalues) == len(shell_asymmetry) + 1: + shell_bvalues = shell_bvalues[1:] + elif len(shell_bvalues) != len(shell_asymmetry): + app.error('Number of b-values reported by mrinfo (' + len(shell_bvalues) + ') does not match number of outputs provided by dirstat (' + len(shell_asymmetry) + ')') + for b, s in zip(shell_bvalues, shell_asymmetry): + if s >= 0.1: + app.warn('sampling of b=' + str(b) + ' shell is ' + ('strongly' if s >= 0.4 else 'moderately') + \ + ' asymmetric; distortion correction may benefit from use of: ' + \ + '-eddy_options " ... --slm=linear ... "') + # Since we want to access user-defined phase encoding information regardless of whether or not # such information is present in the header, let's grab it here diff --git a/cmd/dirstat.cpp b/cmd/dirstat.cpp index 2bfc0d716d..ab6e7990ef 100644 --- a/cmd/dirstat.cpp +++ b/cmd/dirstat.cpp @@ -30,7 +30,7 @@ void usage () SYNOPSIS = "Report statistics on a direction set"; - DESCRIPTION + DESCRIPTION + "This command will accept as inputs:" + "- directions file in spherical coordinates (ASCII text, [ az el ] space-separated values, one per line);" + "- directions file in Cartesian coordinates (ASCII text, [ x y z ] space-separated values, one per line);" @@ -40,7 +40,7 @@ void usage () + "By default, this produces all relevant metrics for the direction set " "provided. If the direction set contains multiple shells, metrics are " "provided for each shell separately." - + + "Metrics are produced assuming a unipolar or bipolar electrostatic " "repulsion model, producing the potential energy (total, mean, min & max), " "and the nearest-neighbour angles (mean, min & max). The condition " @@ -53,12 +53,12 @@ void usage () "option, using these shorthands: U/B for unipolar/bipolar model, E/N " "for energy and nearest-neighbour respectively, t/-/+ for total/min/max " "respectively (mean implied otherwise); SHn for condition number of SH fit " - "at order n (with n an even integer); SYM for symmetry index (norm of " + "at order n (with n an even integer); ASYM for asymmetry index (norm of " "mean direction vector); and N for the number of directions. For example:" + "-output BN,BN-,BN+ requests the mean, min and max nearest-neighour " - "angles assuming a bipolar model." + "angles assuming a bipolar model." + "-output UE,SH8,SYM requests the mean unipolar electrostatic energy, " - "condition number of SH fit at order 8, and the symmetry index."; + "condition number of SH fit at order 8, and the asymmetry index."; ARGUMENTS + Argument ("dirs", "the text file or image containing the directions.").type_file_in(); @@ -81,7 +81,7 @@ void report (const std::string& title, Eigen::MatrixXd& directions); -void run () +void run () { Eigen::MatrixXd directions; @@ -112,14 +112,14 @@ void run () for (size_t n = n_start; n < shells.count(); ++n) { dirs.resize (shells[n].count(), 3); - for (size_t idx = 0; idx < shells[n].count(); ++idx) + for (size_t idx = 0; idx < shells[n].count(); ++idx) dirs.row (idx) = directions.row (shells[n].get_volumes()[idx]).head (3); report (std::string (argument[0]) + " (b=" + str(shells[n].get_mean()) + ")", dirs); } } - else + else report (argument[0], directions); } @@ -128,7 +128,7 @@ void run () vector summarise_NN (const vector& NN) -{ +{ double NN_min = std::numeric_limits::max(); double NN_mean = 0.0; double NN_max = 0.0; @@ -149,7 +149,7 @@ vector summarise_NN (const vector& NN) -vector summarise_E (const vector& E) +vector summarise_E (const vector& E) { double E_min = std::numeric_limits::max(); double E_total = 0.0; @@ -168,7 +168,7 @@ vector summarise_E (const vector& E) class Metrics { public: vector BN, UN, BE, UE, SH; - default_type SYM; + default_type ASYM; size_t ndirs; }; @@ -179,7 +179,7 @@ class Metrics { Metrics compute (Eigen::MatrixXd& directions) { - if (directions.cols() < 3) + if (directions.cols() < 3) throw Exception ("unexpected matrix size for scheme \"" + str(argument[0]) + "\""); DWI::normalise_grad (directions); @@ -218,10 +218,10 @@ Metrics compute (Eigen::MatrixXd& directions) metrics.UE = summarise_E (E_unipolar); metrics.BE = summarise_E (E_bipolar); - for (size_t lmax = 2; lmax <= Math::SH::LforN (directions.rows()); lmax += 2) + for (size_t lmax = 2; lmax <= Math::SH::LforN (directions.rows()); lmax += 2) metrics.SH.push_back (DWI::condition_number_for_lmax (directions, lmax)); - metrics.SYM = directions.leftCols(3).colwise().mean().norm(); + metrics.ASYM = directions.leftCols(3).colwise().mean().norm(); return metrics; } @@ -232,25 +232,26 @@ Metrics compute (Eigen::MatrixXd& directions) void output_selected (const Metrics& metrics, const std::string& selection) { auto select = split (selection, ", \t\n", true); - + for (const auto& x : select) { - if (x == "UEt") std::cout << metrics.UE[0] << " "; - else if (x == "UE") std::cout << metrics.UE[1] << " "; - else if (x == "UE-") std::cout << metrics.UE[2] << " "; - else if (x == "UE+") std::cout << metrics.UE[3] << " "; - else if (x == "BEt") std::cout << metrics.BE[0] << " "; - else if (x == "BE") std::cout << metrics.BE[1] << " "; - else if (x == "BE-") std::cout << metrics.BE[2] << " "; - else if (x == "BE+") std::cout << metrics.BE[3] << " "; - else if (x == "UN") std::cout << metrics.UN[0] << " "; - else if (x == "UN-") std::cout << metrics.UN[1] << " "; - else if (x == "UN+") std::cout << metrics.UN[2] << " "; - else if (x == "BN") std::cout << metrics.BN[0] << " "; - else if (x == "BN-") std::cout << metrics.BN[1] << " "; - else if (x == "BN+") std::cout << metrics.BN[2] << " "; - else if (x == "SYM") std::cout << metrics.SYM << " "; - else if (x == "N") std::cout << metrics.ndirs << " "; - else if (x.substr(0,2) == "SH") { + const auto xl = lowercase(x); + if (xl == "uet") std::cout << metrics.UE[0] << " "; + else if (xl == "ue") std::cout << metrics.UE[1] << " "; + else if (xl == "ue-") std::cout << metrics.UE[2] << " "; + else if (xl == "ue+") std::cout << metrics.UE[3] << " "; + else if (xl == "bet") std::cout << metrics.BE[0] << " "; + else if (xl == "be") std::cout << metrics.BE[1] << " "; + else if (xl == "be-") std::cout << metrics.BE[2] << " "; + else if (xl == "be+") std::cout << metrics.BE[3] << " "; + else if (xl == "un") std::cout << metrics.UN[0] << " "; + else if (xl == "un-") std::cout << metrics.UN[1] << " "; + else if (xl == "un+") std::cout << metrics.UN[2] << " "; + else if (xl == "bn") std::cout << metrics.BN[0] << " "; + else if (xl == "bn-") std::cout << metrics.BN[1] << " "; + else if (xl == "bn+") std::cout << metrics.BN[2] << " "; + else if (xl == "asym") std::cout << metrics.ASYM << " "; + else if (xl == "n") std::cout << metrics.ndirs << " "; + else if (xl.substr(0,2) == "sh") { size_t order = to(x.substr(2)); if (order & 1U || order < 2) throw Exception ("spherical harmonic order must be an even positive integer"); @@ -259,7 +260,7 @@ void output_selected (const Metrics& metrics, const std::string& selection) throw Exception ("spherical harmonic order requested is too large given number of directions"); std::cout << metrics.SH[order] << " "; } - else + else throw Exception ("unknown output specifier \"" + x + "\""); } @@ -291,9 +292,9 @@ void report (const std::string& title, Eigen::MatrixXd& directions) output += "\n Spherical Harmonic fit:\n condition numbers for lmax = 2 -> " + str(metrics.SH.size()*2) + ": " + str(metrics.SH, precision) + "\n"; - output += "\n Symmetry of sampling:\n norm of mean direction vector = " + str(metrics.SYM, precision) + "\n"; - if (metrics.SYM >= 0.1) - output += std::string(" WARNING: sampling is ") + ( metrics.SYM >= 0.4 ? "strongly" : "moderately" ) + output += "\n Asymmetry of sampling:\n norm of mean direction vector = " + str(metrics.ASYM, precision) + "\n"; + if (metrics.ASYM >= 0.1) + output += std::string(" WARNING: sampling is ") + ( metrics.ASYM >= 0.4 ? "strongly" : "moderately" ) + " asymmetric - this may affect resiliance to eddy-current distortions\n"; output += "\n"; diff --git a/docs/reference/commands/dirstat.rst b/docs/reference/commands/dirstat.rst index 20b6d16d52..8c4a986f1b 100644 --- a/docs/reference/commands/dirstat.rst +++ b/docs/reference/commands/dirstat.rst @@ -17,29 +17,38 @@ Usage - *dirs*: the text file or image containing the directions. -Options -------- +Description +----------- + +This command will accept as inputs: + +- directions file in spherical coordinates (ASCII text, [ az el ] space-separated values, one per line); -Output options -^^^^^^^^^^^^^^ +- directions file in Cartesian coordinates (ASCII text, [ x y z ] space-separated values, one per line); -- **-bipolar** output statistics for bipolar electrostatic repulsion model +- DW gradient files (MRtrix format: ASCII text, [ x y z b ] space-separated values, one per line); -- **-unipolar** output statistics for unipolar electrostatic repulsion model +- image files, using the DW gradient scheme found in the header (or provided using the appropriate command line options below). -- **-shfit** output statistics for spherical harmonics fit +By default, this produces all relevant metrics for the direction set provided. If the direction set contains multiple shells, metrics are provided for each shell separately. -- **-symmetry** output measure of symmetry of spherical coverage (as given by the norm of mean direction vector). This is important to ensure minimal bias due to eddy-currents. +Metrics are produced assuming a unipolar or bipolar electrostatic repulsion model, producing the potential energy (total, mean, min & max), and the nearest-neighbour angles (mean, min & max). The condition number is also produced for the spherical harmonic fits up to the highest harmonic order supported by the number of volumes. Finally, the norm of the mean direction vector is provided as a measure of the overall symmetry of the direction set (important with respect to eddy-current resilience). -- **-nearest_neighour** output nearest-neighbour angle statistics +Specific metrics can also be queried independently via the "-output" option, using these shorthands: U/B for unipolar/bipolar model, E/N for energy and nearest-neighbour respectively, t/-/+ for total/min/max respectively (mean implied otherwise); SHn for condition number of SH fit at order n (with n an even integer); ASYM for asymmetry index (norm of mean direction vector); and N for the number of directions. For example: -- **-energy** output energy statistics +-output BN,BN-,BN+ requests the mean, min and max nearest-neighour angles assuming a bipolar model. + +-output UE,SH8,SYM requests the mean unipolar electrostatic energy, condition number of SH fit at order 8, and the asymmetry index. + +Options +------- -- **-total** output total of statistic (affects -energy only) +- **-output list** output selected metrics as a space-delimited list, suitable for use in scripts. This will produce one line of values per selected shell. Valid metrics are as specified in the description above. -- **-mean** output mean of statistic (affects -nearest_neighbour or -energy only) +DW shell selection options +^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-range** output range of statistic (affects -nearest_neighbour or -energy only) +- **-shells list** specify one or more diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. DW gradient table import options ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -50,11 +59,6 @@ DW gradient table import options - **-bvalue_scaling mode** specifies whether the b-values should be scaled by the square of the corresponding DW gradient norm, as often required for multi-shell or DSI DW acquisition schemes. The default action can also be set in the MRtrix config file, under the BValueScaling entry. Valid choices are yes/no, true/false, 0/1 (default: true). -DW shell selection options -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -- **-shells list** specify one or more diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. - Standard options ^^^^^^^^^^^^^^^^ From 2fac6bc2c352d2b50ebbaa94a98b8f024b6a8e37 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 1 Nov 2017 13:35:13 +1100 Subject: [PATCH 221/538] tckstats: New option -explicit Use of this option forces tckstats to explicitly calculate the length of every streamline based on the distance between every sequential vertex pair, rather than relying on track file header information regarding step size to speed up the calculation. This is particularly important if some non-rigid transformation has been applied to the track data. --- cmd/tckstats.cpp | 16 ++++++++++------ docs/reference/commands/tckstats.rst | 2 ++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/cmd/tckstats.cpp b/cmd/tckstats.cpp index 89d69c0c73..d3b6a7d0ec 100644 --- a/cmd/tckstats.cpp +++ b/cmd/tckstats.cpp @@ -64,6 +64,9 @@ void usage () + Option ("dump", "dump the streamlines lengths to a text file") + Argument ("path").type_file_out() + + Option ("explicit", "explicitly calculate the length of each streamline, " + "ignoring any step size information present in the header") + + Option ("ignorezero", "do not generate a warning if the track file contains streamlines with zero length") + Tractography::TrackWeightsInOption; @@ -118,12 +121,13 @@ void run () if (properties.find ("count") != properties.end()) header_count = to (properties["count"]); - step_size = get_step_size (properties); - - if (!std::isfinite (step_size) || !step_size) { - INFO ("Streamline step size undefined in header; lengths will be calculated manually"); - if (get_options ("histogram").size()) { - WARN ("Do not have streamline step size with which to construct histogram; histogram will be generated using 1mm bin widths"); + if (!get_options ("explicit").size()) { + step_size = get_step_size (properties); + if (!std::isfinite (step_size) || !step_size) { + INFO ("Streamline step size undefined in header; lengths will be calculated manually"); + if (get_options ("histogram").size()) { + WARN ("Do not have streamline step size with which to construct histogram; histogram will be generated using 1mm bin widths"); + } } } diff --git a/docs/reference/commands/tckstats.rst b/docs/reference/commands/tckstats.rst index 6089aa3a9d..b302e83bf5 100644 --- a/docs/reference/commands/tckstats.rst +++ b/docs/reference/commands/tckstats.rst @@ -26,6 +26,8 @@ Options - **-dump path** dump the streamlines lengths to a text file +- **-explicit** explicitly calculate the length of each streamline, ignoring any step size information present in the header + - **-ignorezero** do not generate a warning if the track file contains streamlines with zero length - **-tck_weights_in path** specify a text scalar file containing the streamline weights From c3c0a09c399e183f598df88372c518e41a81f235 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 1 Nov 2017 16:04:17 +1100 Subject: [PATCH 222/538] dwipreproc: Compatibity for --mporder and padding If the number of slices in an axis of the image is odd, and topup is being used, then dwipreproc will duplicate the final slice along that axis, in order to prevent a fatal crash in topup. However, if slice-to-volume correction is being used, and there are an odd number of slices, then this padding will result in a mismatch between the number of slices in the image data and the number of entries in the slice timing data. These changes compensate for this by correspondingly altering the slice timing information, and delaying writing that information to file until after image padding has taken place. --- bin/dwipreproc | 121 ++++++++++++++++++++++++++++--------------- lib/mrtrix3/image.py | 26 ++++++++++ 2 files changed, 105 insertions(+), 42 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 5bcd37d05e..5936fb28ab 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -22,7 +22,7 @@ if not os.path.isdir(lib_folder): sys.exit(1) sys.path.insert(0, lib_folder) -import math, itertools, shutil +import math, itertools from mrtrix3 import app, file, fsl, image, path, phaseEncoding, run #pylint: disable=redefined-builtin @@ -139,13 +139,14 @@ if app.args.se_epi: app.gotoTempDir() - # Get information on the input images, and check their validity dwi_header = image.Header('dwi.mif') if not len(dwi_header.size()) == 4: app.error('Input DWI must be a 4D image') dwi_num_volumes = dwi_header.size()[3] app.var(dwi_num_volumes) +dwi_num_slices = dwi_header.size()[2] +app.var(dwi_num_slices) dwi_pe_scheme = phaseEncoding.getScheme(dwi_header) if app.args.se_epi: se_epi_header = image.Header('se_epi.mif') @@ -158,53 +159,48 @@ if 'dw_scheme' not in dwi_header.keyval(): grad = dwi_header.keyval()['dw_scheme'] if not len(grad) == dwi_num_volumes: app.error('Number of lines in gradient table (' + str(len(grad)) + ') does not match input image (' + str(dwi_num_volumes) + ' volumes); check your input data') -if any(s.startswith('--mporder') for s in eddy_manual_options): - slice_encoding_direction = '' + +# Check the manual options being passed to eddy, ensure they make sense +eddy_mporder = any(s.startswith('--mporder') for s in eddy_manual_options) +if eddy_mporder: if 'SliceEncodingDirection' in dwi_header.keyval(): slice_encoding_direction = dwi_header.keyval()['SliceEncodingDirection'] app.var(slice_encoding_direction) if not slice_encoding_direction.startswith('k'): app.error('DWI header indicates that 3rd spatial axis is not the slice axis; this is not yet compatible with --mporder option in eddy, nor supported in dwipreproc') - - -# Check the manual options being passed to eddy, ensure they make sense + slice_encoding_direction = image.axis2dir(slice_encoding_direction) + else: + app.console('No slice encoding direction information present; assuming third axis corresponds to slices') + slice_encoding_direction = [0,0,1] if '--resamp=lsr' in eddy_manual_options: app.error('dwipreproc does not currently support least-squares reconstruction; this cannot be simply passed via -eddy_options') -if any(s.startswith('--mporder') for s in eddy_manual_options): +if eddy_mporder: slspec_option = [ s for s in eddy_manual_options if s.startswith('--slspec') ] + slice_groups = [ ] + slice_timing = [ ] if len(slspec_option) > 1: app.error('--slspec option appears more than once in -eddy_options input; cannot import slice timing') elif len(slspec_option) == 1: slspec_file_path = path.fromUser(slspec_option[0][9:], False) if os.path.isfile(slspec_file_path): - run.function(shutil.copy, slspec_file_path, 'slspec.txt') + # Since there's a chance that we may need to pad this info, we can't just copy this file + # to the temporary directory... + with open(slspec_file_path, 'r') as f: + for line in f: + slice_groups.append(int(value) for value in line.split()) + app.var(slice_groups) + # Remove this entry from eddy_manual_options; it'll be inserted later, with the + # path to the new slspec file eddy_manual_options = [ s for s in eddy_manual_options if not s.startswith('--slspec') ] - eddy_manual_options.append('--slspec=slspec.txt') else: app.error('Unable to find \'slspec\' file provided via -eddy_options \" ... --slspec=/path/to/file ... \" (expected location: ' + slspec_file_path + ')') else: if 'SliceTiming' not in dwi_header.keyval(): app.error('Cannot perform slice-to-volume correction in eddy: No slspec file provided, and no slice timing information present in header') slice_timing = dwi_header.keyval()['SliceTiming'][0] - if len(slice_timing) != dwi_header.size()[2]: + app.var(slice_timing) + if len(slice_timing) != dwi_num_slices: app.error('Cannot use slice timing information in image header for slice-to-volume correction: Number of entries (' + len(slice_timing) + ') does not match number of slices (' + dwi_header.size()[2] + ')') - # This list contains, for each slice, the timing offset between acquisition of the - # first slice in the volume, and acquisition of that slice - # Eddy however requires a text file where each row contains those slices that were - # acquired with a single readout, in ordered rows from first slice (group) - # acquired to last slice (group) acquired - if '-' in slice_encoding_direction: - slice_timing = reversed(slice_timing) - slspec = [ [ x[0] for x in g ] for _, g in itertools.groupby(sorted(enumerate(slice_timing), key=lambda x:x[1]), key=lambda x:x[1]) ] #pylint: disable=unused-variable - app.var(slice_timing, slspec) - with open('slspec.txt', 'w') as f: - for line in slspec: - f.write(' '.join(str(value) for value in line) + '\n') - eddy_manual_options.append('--slspec=slspec.txt') - - -# Revert eddy_manual_options from a list back to a single string -eddy_manual_options = (' ' + ' '.join(eddy_manual_options)) if eddy_manual_options else '' # Since we want to access user-defined phase encoding information regardless of whether or not @@ -383,7 +379,6 @@ if dwi_manual_pe_scheme: import_dwi_pe_table_option = ' -import_pe_table dwi_manual_pe_scheme.txt' - # Find the index of the first DWI volume that is a b=0 volume # This needs to occur at the outermost loop as it is pertinent information # not only for the -align_seepi option, but also for when the -se_epi option @@ -399,7 +394,6 @@ for line in grad: app.var(dwi_first_bzero_index) - # Deal with the phase-encoding of the images to be fed to topup (if applicable) overwrite_se_epi_pe_scheme = False se_epi_path = 'se_epi.mif' @@ -602,7 +596,6 @@ elif not PE_design == 'None': # No SE EPI images explicitly provided: In some ca se_epi_header = None - # If the first b=0 volume in the DWIs is in fact not the first volume (i.e. index zero), we're going to # manually place it at the start of the DWI volumes when they are input to eddy, so that the # first input volume to topup and the first input volume to eddy are one and the same. @@ -639,7 +632,6 @@ if se_epi_manual_pe_scheme: run.command('mrinfo dwi.mif -export_grad_mrtrix grad.b') - eddy_in_topup_option = '' dwi_post_eddy_crop_option = '' dwi_path = 'dwi.mif' @@ -672,6 +664,25 @@ if do_topup: file.delTemporary(dwi_path) dwi_path = new_dwi_path dwi_post_eddy_crop_option += ' -coord ' + str(axis) + ' 0:' + str(axis_size-1) + # If we are padding the slice axis, and performing slice-to-volume correction, + # then we need to perform the corresponding padding to the slice timing + if eddy_mporder and slice_encoding_direction[axis]: + dwi_num_slices += 1 + # At this point in the script, this information may be encoded either within + # the slice timing vector (as imported from the image header), or as + # slice groups (i.e. in the format expected by eddy). How these data are + # stored affects how the padding is performed. + if slice_timing: + slice_timing.append(slice_timing[-1]) + elif slice_groups: + # Can't edit in place when looping through the list + new_slice_groups = [ ] + for group in slice_groups: + if axis_size-1 in group: + group.append(axis_size) + new_slice_groups.append(group) + slice_groups = new_slice_groups + # Do the conversion in preparation for topup run.command('mrconvert ' + se_epi_path + ' topup_in.nii' + import_se_epi_manual_pe_table_option + ' -stride -1,+2,+3,+4 -export_pe_table topup_datain.txt') @@ -691,6 +702,7 @@ if do_topup: else: run.command('mrinfo ' + dwi_path + ' -export_pe_eddy applytopup_config.txt applytopup_indices.txt') + # Update: Call applytopup separately for each unique phase-encoding # This should be the most compatible option with more complex phase-encoding acquisition designs, # since we don't need to worry about applytopup performing volume recombination @@ -731,13 +743,44 @@ else: run.command('dwi2mask ' + dwi_path + ' - | maskfilter - dilate - | mrconvert - eddy_mask.nii -datatype float32 -stride -1,+2,+3') +# Generate the text file containing slice timing / grouping information if necessary +if eddy_mporder: + if slice_timing: + # This list contains, for each slice, the timing offset between acquisition of the + # first slice in the volume, and acquisition of that slice + # Eddy however requires a text file where each row contains those slices that were + # acquired with a single readout, in ordered rows from first slice (group) + # acquired to last slice (group) acquired + if sum(slice_encoding_direction) < 0: + slice_timing = reversed(slice_timing) + slice_groups = [ [ x[0] for x in g ] for _, g in itertools.groupby(sorted(enumerate(slice_timing), key=lambda x:x[1]), key=lambda x:x[1]) ] #pylint: disable=unused-variable + app.var(slice_timing, slice_groups) + # Variable slice_groups may have already been defined in the correct format. + # In that instance, there's nothing to do other than write it to file; + # UNLESS the slice encoding direction is known to be reversed, in which case + # we need to reverse the timings. Would think that this would however be + # rare, given it requires that the slspec text file be provided manually but + # SliceEncodingDirection to be present. + elif slice_groups and sum(slice_encoding_direction) < 0: + new_slice_groups = [ ] + for group in new_slice_groups: + new_slice_groups.append([ dwi_num_slices-index for index in group ]) + app.var(slice_groups, new_slice_groups) + slice_groups = new_slice_groups + + with open('slspec.txt', 'w') as f: + for line in slice_groups: + f.write(' '.join(str(value) for value in line) + '\n') + eddy_manual_options.append('--slspec=slspec.txt') + + +# Revert eddy_manual_options from a list back to a single string +eddy_manual_options = (' ' + ' '.join(eddy_manual_options)) if eddy_manual_options else '' + # Run eddy run.command('mrconvert ' + dwi_path + import_dwi_pe_table_option + dwi_permute_volumes_pre_eddy_option + ' eddy_in.nii -stride -1,+2,+3,+4 -export_grad_fsl bvecs bvals -export_pe_eddy eddy_config.txt eddy_indices.txt') file.delTemporary(dwi_path) -eddy_manual_options = '' -if app.args.eddy_options: - eddy_manual_options = ' ' + app.args.eddy_options.strip() run.command(eddy_cmd + ' --imain=eddy_in.nii --mask=eddy_mask.nii --acqp=eddy_config.txt --index=eddy_indices.txt --bvecs=bvecs --bvals=bvals' + eddy_in_topup_option + eddy_manual_options + ' --out=dwi_post_eddy') file.delTemporary('eddy_in.nii') file.delTemporary('eddy_mask.nii') @@ -746,12 +789,10 @@ if do_topup: eddy_output_image_path = fsl.findImage('dwi_post_eddy') - # Get the axis strides from the input series, so the output image can be modified to match stride_option = ' -stride ' + ','.join([str(i) for i in dwi_header.stride()]) - # Check to see whether or not eddy has provided a rotated bvecs file; # if it has, import this into the output image bvecs_path = 'dwi_post_eddy.eddy_rotated_bvecs' @@ -760,7 +801,6 @@ if not os.path.isfile(bvecs_path): bvecs_path = 'bvecs' - # Determine whether or not volume recombination should be performed # This could be either due to use of -rpe_all option, or just due to the data provided with -rpe_header # Rather than trying to re-use the code that was used in the case of -rpe_all, run fresh code @@ -845,7 +885,6 @@ else: f.write(' '.join( [ str(b) for b in bvals_combined ] )) - # Prior to 5.0.8, a bug resulted in the output field map image from topup having an identity transform, # regardless of the transform of the input image # Detect this, and manually replace the transform if necessary @@ -861,7 +900,6 @@ else: file.delTemporary('topup_in.nii') - # Derive the weight images # Scaling term for field map is identical to the bandwidth provided in the topup config file # (converts Hz to pixel count; that way a simple image gradient can be used to get the Jacobians) @@ -873,8 +911,7 @@ else: eddy_config = [ [ float(f) for f in line.split() ] for line in open('eddy_config.txt', 'r').read().split('\n')[:-1] ] eddy_indices = [ int(i) for i in open('eddy_indices.txt', 'r').read().split() ] - app.var(eddy_config) - app.var(eddy_indices) + app.var(eddy_config, eddy_indices) # This section derives, for each phase encoding configuration present, the 'weight' to be applied # to the image during volume recombination, which is based on the Jacobian of the field in the diff --git a/lib/mrtrix3/image.py b/lib/mrtrix3/image.py index 07499ae965..8c10321ea3 100644 --- a/lib/mrtrix3/image.py +++ b/lib/mrtrix3/image.py @@ -64,6 +64,32 @@ def keyval(self): +# From a string corresponding to a NIfTI axis & direction code, +# yield a 3-vector corresponding to that axis and direction +# Note that unlike phaseEncoding.direction(), this does not accept +# an axis index, nor a phase-encoding indication string (e.g. AP); +# it only accepts NIfTI codes, i.e. i, i-, j, j-, k, k- +def axis2dir(string): #pylint: disable=unused-variable + from mrtrix3 import app + if string == 'i': + direction = [1,0,0] + elif string == 'i-': + direction = [-1,0,0] + elif string == 'j': + direction = [0,1,0] + elif string == 'j-': + direction = [0,-1,0] + elif string == 'k': + direction = [0,0,1] + elif string == 'k-': + direction = [0,0,-1] + else: + app.error('Unrecognized NIfTI axis & direction specifier: ' + string) + app.debug(string + ' -> ' + str(direction)) + return direction + + + # Determine whether or not an image contains at least three axes, the first three of which # have dimension greater than one: This means that the data can plausibly represent # spatial information, and 3D interpolation can be performed From e95be312349a42414fa1d2ad60b9c0e00657fef1 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Wed, 1 Nov 2017 09:53:24 +0000 Subject: [PATCH 223/538] dirstat: fix memalign issue --- cmd/dirstat.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/dirstat.cpp b/cmd/dirstat.cpp index ab6e7990ef..52bdeb0386 100644 --- a/cmd/dirstat.cpp +++ b/cmd/dirstat.cpp @@ -165,7 +165,8 @@ vector summarise_E (const vector& E) -class Metrics { +class Metrics +{ MEMALIGN (Metrics) public: vector BN, UN, BE, UE, SH; default_type ASYM; From badd87770301bb5262c166b15db7d2fd3d68a1b6 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 3 Nov 2017 14:47:19 +1100 Subject: [PATCH 224/538] DICOM: Enhanced Siemens CSA capability - Expand list of element codes that are used to identify Siemens CSA data. - Support CSA1 format. --- core/file/dicom/csa_entry.h | 59 +++++++++++++++++++++++----------- core/file/dicom/dict.cpp | 12 ++++--- core/file/dicom/image.cpp | 9 ++++-- core/file/dicom/quick_scan.cpp | 47 +++++++++++++++------------ 4 files changed, 81 insertions(+), 46 deletions(-) diff --git a/core/file/dicom/csa_entry.h b/core/file/dicom/csa_entry.h index 07a0c1f5f2..e4983dbbcf 100644 --- a/core/file/dicom/csa_entry.h +++ b/core/file/dicom/csa_entry.h @@ -26,45 +26,66 @@ namespace MR { class CSAEntry { NOMEMALIGN public: CSAEntry (const uint8_t* start_p, const uint8_t* end_p, bool output_fields = false) : - start (start_p), - end (end_p), - print (output_fields) { - if (strncmp ("SV10", (const char*) start, 4)) - DEBUG ("WARNING: CSA data is not in SV10 format"); - - cnum = 0; + start (start_p), + end (end_p), + print (output_fields), + cnum (0) + { + if (strncmp ("SV10", (const char*) start, 4)) { + num = Raw::fetch_LE (start); + if (num < 1 || num > 128) { + DEBUG ("WARNING: CSA1 format with invalid number of tags (" + str(num) + "); ignoring"); + cnum = num; + next = end; + } else { + const uint32_t unused = Raw::fetch_LE (start+4); + if (unused != 77) + DEBUG ("CSA1 \'unused\' integer field contains " + str(unused) + "; expected 77"); + next = start + 8; + } + } else { + const uint8_t* const unused1 = start+4; + if (unused1[0] != 0x04U || unused1[1] != 0x03U || unused1[2] != 0x02U || unused1[3] != 0x01U) + DEBUG ("WARNING: CSA2 \'unused1\' int8 field contains unexpected data"); num = Raw::fetch_LE (start+8); + const uint32_t unused2 = Raw::fetch_LE (start+12); + if (unused2 != 77) + DEBUG ("CSA2 \'unused2\' integer field contains " + str(unused2) + "; expected 77"); next = start + 16; } + } bool parse () { - if (cnum >= num) + if (cnum >= num) return false; start = next; - if (start >= end + 84) + if (start >= end + 84) return false; strncpy (name, (const char*) start, 64); Raw::fetch_LE (start+64); // vm strncpy (vr, (const char*) start+68, 4); Raw::fetch_LE (start+72); // syngodt nitems = Raw::fetch_LE (start+76); - if (print) + const int32_t xx = Raw::fetch_LE (start+80); + if (!(xx == 77 || xx == 205)) + DEBUG ("CSA tag \'xx\' integer field contains " + str(xx) + "; expected 77 or 205"); + if (print) fprintf (stdout, " [CSA] %s: ", name); next = start + 84; - if (next + 4 >= end) + if (next + 4 >= end) return false; for (uint32_t m = 0; m < nitems; m++) { uint32_t length = Raw::fetch_LE (next); size_t size = 16 + 4*((length+3)/4); - if (next + size > end) + if (next + size > end) return false; - if (print) + if (print) fprintf (stdout, "%.*s ", length, (const char*) next+16); next += size; } - if (print) + if (print) fprintf (stdout, "\n"); cnum++; @@ -72,11 +93,11 @@ namespace MR { } const char* key () const { return (name); } - int get_int () const { + int get_int () const { const uint8_t* p = start + 84; for (uint32_t m = 0; m < nitems; m++) { uint32_t length = Raw::fetch_LE (p); - if (length) + if (length) return to (std::string (reinterpret_cast (p)+16, 4*((length+3)/4))); p += 16 + 4*((length+3)/4); } @@ -87,7 +108,7 @@ namespace MR { const uint8_t* p = start + 84; for (uint32_t m = 0; m < nitems; m++) { uint32_t length = Raw::fetch_LE (p); - if (length) + if (length) return to (std::string (reinterpret_cast (p)+16, 4*((length+3)/4))); p += 16 + 4*((length+3)/4); } @@ -98,7 +119,7 @@ namespace MR { const uint8_t* p = start + 84; for (uint32_t m = 0; m < nitems; m++) { uint32_t length = Raw::fetch_LE (p); - if (length) + if (length) v[m] = to (std::string (reinterpret_cast (p)+16, 4*((length+3)/4))); p += 16 + 4*((length+3)/4); } @@ -111,7 +132,7 @@ namespace MR { for (uint32_t m = 0; m < item.nitems; m++) { uint32_t length = Raw::fetch_LE (next); size_t size = 16 + 4*((length+3)/4); - while (length > 0 && !next[16+length-1]) + while (length > 0 && !next[16+length-1]) length--; stream << " "; stream.write (reinterpret_cast (next)+16, length); diff --git a/core/file/dicom/dict.cpp b/core/file/dicom/dict.cpp index b34e3e9016..33b2eaf8f9 100644 --- a/core/file/dicom/dict.cpp +++ b/core/file/dicom/dict.cpp @@ -31,7 +31,7 @@ namespace MR { /* the following was generated by running the following command on the dicom dictionary file: - awk '{ print "dict[0x"$1$2"UL] = \""$3$4"\";" }' dict.txt + awk '{ print "dict[0x"$1$2"UL] = \""$3$4"\";" }' dict.txt */ @@ -3557,9 +3557,13 @@ namespace MR { // Siemens private tags: dict[0x0019100CUL] = "DSSiemensBValue"; dict[0x0019100EUL] = "FDSiemensDWDirection"; - dict[0x00291010UL] = "UNSiemensCSA1"; - dict[0x00291020UL] = "UNSiemensCSA2"; - + dict[0x00291010UL] = "UNSiemensCSA_1010"; + dict[0x00291020UL] = "UNSiemensCSA_1020"; + dict[0x00291110UL] = "UNSiemensCSA_1110"; + dict[0x00291120UL] = "UNSiemensCSA_1120"; + dict[0x00291210UL] = "UNSiemensCSA_1210"; + dict[0x00291220UL] = "UNSiemensCSA_1220"; + } } } diff --git a/core/file/dicom/image.cpp b/core/file/dicom/image.cpp index b2cf3f3a54..661bfd8c27 100644 --- a/core/file/dicom/image.cpp +++ b/core/file/dicom/image.cpp @@ -239,8 +239,14 @@ namespace MR { } return; case 0x0029U: // Siemens CSA entry - if (item.element == 0x1010U || item.element == 0x1020U) + if (item.element == 0x1010U || + item.element == 0x1020U || + item.element == 0x1110U || + item.element == 0x1120U || + item.element == 0x1210U || + item.element == 0x1220U) { decode_csa (item.data, item.data + item.size); + } return; case 0x0043U: // GEMS_PARMS_01 block if (item.element == 0x1039U) { @@ -323,7 +329,6 @@ namespace MR { if (G[0] && bvalue) if (fabs(G[0]) > 1.0 && fabs(G[1]) > 1.0 && fabs(G[2]) > 1.0) bvalue = G[0] = G[1] = G[2] = 0.0; - } diff --git a/core/file/dicom/quick_scan.cpp b/core/file/dicom/quick_scan.cpp index e69a02e514..5c75593fa2 100644 --- a/core/file/dicom/quick_scan.cpp +++ b/core/file/dicom/quick_scan.cpp @@ -43,8 +43,8 @@ namespace MR { Element item; try { - item.set (filename, force_read); - std::string current_image_type; + item.set (filename, force_read); + std::string current_image_type; bool in_frames = false; while (item.read()) { @@ -75,13 +75,18 @@ namespace MR { } } - if (print_DICOM_fields) + if (print_DICOM_fields) print (str(item)); if (print_CSA_fields && item.group == 0x0029U) { - if (item.element == 0x1010U || item.element == 0x1020U) { + if (item.element == 0x1010U || + item.element == 0x1020U || + item.element == 0x1110U || + item.element == 0x1120U || + item.element == 0x1210U || + item.element == 0x1220U) { CSAEntry entry (item.data, item.data + item.size); - while (entry.parse()) + while (entry.parse()) print (str (entry)); } } @@ -92,9 +97,9 @@ namespace MR { transfer_syntax_supported = item.transfer_syntax_supported; } - catch (Exception& E) { + catch (Exception& E) { E.display (3); - return true; + return true; } return false; @@ -107,21 +112,21 @@ namespace MR { std::ostream& operator<< (std::ostream& stream, const QuickScan& file) { - stream << "file: \"" - << file.filename << "\" [" - << file.modality << "]:\n patient: " - << file.patient << " " - << format_ID(file.patient_ID) << " - " - << format_date (file.patient_DOB) << "\n study: " - << ( file.study.size() ? file.study : "[unspecified]" ) << " " - << format_ID(file.study_ID) << " - " - << format_date (file.study_date) << " " - << format_time (file.study_time) << "\n series: [" - << file.series_number << "] " - << ( file.series.size() ? file.series : "[unspecified]" ) << " - " - << format_date (file.series_date) << " " + stream << "file: \"" + << file.filename << "\" [" + << file.modality << "]:\n patient: " + << file.patient << " " + << format_ID(file.patient_ID) << " - " + << format_date (file.patient_DOB) << "\n study: " + << ( file.study.size() ? file.study : "[unspecified]" ) << " " + << format_ID(file.study_ID) << " - " + << format_date (file.study_date) << " " + << format_time (file.study_time) << "\n series: [" + << file.series_number << "] " + << ( file.series.size() ? file.series : "[unspecified]" ) << " - " + << format_date (file.series_date) << " " << format_time (file.series_time) << "\n"; - for (const auto& type : file.image_type) + for (const auto& type : file.image_type) stream << " image type: " << type.first << " [ " << type.second << " frames ]\n"; stream << " sequence: " << ( file.sequence.size() ? file.sequence : "[unspecified]" ) << "\n"; From 59eb7deeef07a708b14e051d9ec92b1380b1279e Mon Sep 17 00:00:00 2001 From: Lestropie Date: Fri, 3 Nov 2017 16:29:38 +1100 Subject: [PATCH 225/538] dwipreproc: Minor fix to slice-to-volume support --- bin/dwipreproc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index 5936fb28ab..b22635b49f 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -187,7 +187,9 @@ if eddy_mporder: # to the temporary directory... with open(slspec_file_path, 'r') as f: for line in f: - slice_groups.append(int(value) for value in line.split()) + line = line.strip() + if line: + slice_groups.append([int(value) for value in line.split()]) app.var(slice_groups) # Remove this entry from eddy_manual_options; it'll be inserted later, with the # path to the new slspec file From b53a9e59ac185ba47457f5a97dc6bee41d711963 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 3 Nov 2017 17:44:59 +1100 Subject: [PATCH 226/538] Final tweaks for dwipreproc slice-to-volume correction - Don't attempt to erase header key-value entries that will never be there due to NIfTI conversion; will just produce unwarranted warnings. - Disable pylint testing the number of lines in the file (dwipreproc is now close to 1000 lines). --- bin/dwipreproc | 10 +++++++--- testing/pylint.rc | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index b22635b49f..e02cd5c5a8 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -981,10 +981,14 @@ else: # output image, as they may have been useful for controlling pre-processing # but are no longer required, and will just bloat the key-value listings of # all subsequent derived images -keys_to_remove = [ 'EchoTime', 'FlipAngle', 'MultibandAccelerationFactor', 'PhaseEncodingDirection', 'RepetitionTime', 'SliceEncodingDirection', 'SliceTiming', 'TotalReadoutTime', 'pe_scheme' ] -clear_property_options = ' ' + ' '.join(['-clear_property '+key for key in keys_to_remove if key in dwi_header.keyval() ]) +# Disabled this for now: The output from eddy is a NIfTI, so all these fields +# have been lost. For now just neglect to re-introduce them; in the future, +# this may be combined with GitHub Issue #1188 (proper behaviour of +# command_history header key-value entry when running a Python script) +#keys_to_remove = [ 'EchoTime', 'FlipAngle', 'MultibandAccelerationFactor', 'PhaseEncodingDirection', 'RepetitionTime', 'SliceEncodingDirection', 'SliceTiming', 'TotalReadoutTime', 'pe_scheme' ] +#clear_property_options = ' ' + ' '.join(['-clear_property '+key for key in keys_to_remove if key in dwi_header.keyval() ]) # Finish! -run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + grad_export_option + clear_property_options + (' -force' if app.forceOverwrite else '')) +run.command('mrconvert result.mif ' + path.fromUser(app.args.output, True) + grad_export_option + (' -force' if app.forceOverwrite else '')) app.complete() diff --git a/testing/pylint.rc b/testing/pylint.rc index 61a7a450a3..ef47754d67 100644 --- a/testing/pylint.rc +++ b/testing/pylint.rc @@ -48,7 +48,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" #disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call -disable=invalid-name,line-too-long,bad-whitespace,multiple-imports,wrong-import-position,missing-docstring,global-statement,bare-except,too-many-branches,arguments-differ,too-many-statements,too-many-nested-blocks,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments +disable=invalid-name,line-too-long,bad-whitespace,multiple-imports,wrong-import-position,missing-docstring,global-statement,bare-except,too-many-branches,arguments-differ,too-many-statements,too-many-nested-blocks,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-lines # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option From 2377b6e0ed01313c77a0cb331a61b3d390975216 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Mon, 20 Nov 2017 12:23:36 +1100 Subject: [PATCH 227/538] docs generation --- docs/reference/commands/5tt2gmwmi.rst | 2 +- docs/reference/commands/5tt2vis.rst | 2 +- docs/reference/commands/5ttcheck.rst | 2 +- docs/reference/commands/5ttedit.rst | 2 +- docs/reference/commands/afdconnectivity.rst | 2 +- docs/reference/commands/amp2response.rst | 2 +- docs/reference/commands/amp2sh.rst | 2 +- docs/reference/commands/connectome2tck.rst | 2 +- docs/reference/commands/connectomestats.rst | 2 +- docs/reference/commands/dcmedit.rst | 2 +- docs/reference/commands/dcminfo.rst | 2 +- docs/reference/commands/dirflip.rst | 2 +- docs/reference/commands/dirgen.rst | 2 +- docs/reference/commands/dirmerge.rst | 2 +- docs/reference/commands/dirorder.rst | 2 +- docs/reference/commands/dirsplit.rst | 2 +- docs/reference/commands/dirstat.rst | 2 +- docs/reference/commands/dwi2adc.rst | 2 +- docs/reference/commands/dwi2fod.rst | 2 +- docs/reference/commands/dwi2mask.rst | 2 +- docs/reference/commands/dwi2noise.rst | 2 +- docs/reference/commands/dwi2tensor.rst | 2 +- docs/reference/commands/dwidenoise.rst | 2 +- docs/reference/commands/dwiextract.rst | 2 +- docs/reference/commands/dwinormalise.rst | 2 +- docs/reference/commands/fixel2sh.rst | 2 +- docs/reference/commands/fixel2tsf.rst | 2 +- docs/reference/commands/fixel2voxel.rst | 2 +- docs/reference/commands/fixelcfestats.rst | 2 +- docs/reference/commands/fixelconvert.rst | 2 +- docs/reference/commands/fixelcorrespondence.rst | 2 +- docs/reference/commands/fixelcrop.rst | 2 +- docs/reference/commands/fixelreorient.rst | 2 +- docs/reference/commands/fod2dec.rst | 2 +- docs/reference/commands/fod2fixel.rst | 2 +- docs/reference/commands/label2colour.rst | 2 +- docs/reference/commands/label2mesh.rst | 2 +- docs/reference/commands/labelconvert.rst | 2 +- docs/reference/commands/maskdump.rst | 2 +- docs/reference/commands/maskfilter.rst | 2 +- docs/reference/commands/mesh2pve.rst | 2 +- docs/reference/commands/meshconvert.rst | 2 +- docs/reference/commands/meshfilter.rst | 2 +- docs/reference/commands/mraverageheader.rst | 2 +- docs/reference/commands/mrcalc.rst | 2 +- docs/reference/commands/mrcat.rst | 2 +- docs/reference/commands/mrcheckerboardmask.rst | 2 +- docs/reference/commands/mrclusterstats.rst | 2 +- docs/reference/commands/mrconvert.rst | 2 +- docs/reference/commands/mrcrop.rst | 2 +- docs/reference/commands/mrdegibbs.rst | 2 +- docs/reference/commands/mrdump.rst | 2 +- docs/reference/commands/mredit.rst | 2 +- docs/reference/commands/mrfilter.rst | 2 +- docs/reference/commands/mrhistmatch.rst | 2 +- docs/reference/commands/mrhistogram.rst | 2 +- docs/reference/commands/mrinfo.rst | 2 +- docs/reference/commands/mrmath.rst | 2 +- docs/reference/commands/mrmesh.rst | 2 +- docs/reference/commands/mrmetric.rst | 2 +- docs/reference/commands/mrpad.rst | 2 +- docs/reference/commands/mrregister.rst | 2 +- docs/reference/commands/mrresize.rst | 2 +- docs/reference/commands/mrstats.rst | 2 +- docs/reference/commands/mrthreshold.rst | 2 +- docs/reference/commands/mrtransform.rst | 2 +- docs/reference/commands/mrview.rst | 2 +- docs/reference/commands/mtbin.rst | 2 +- docs/reference/commands/mtnormalise.rst | 2 +- docs/reference/commands/peaks2amp.rst | 2 +- docs/reference/commands/sh2amp.rst | 2 +- docs/reference/commands/sh2peaks.rst | 2 +- docs/reference/commands/sh2power.rst | 2 +- docs/reference/commands/sh2response.rst | 2 +- docs/reference/commands/shbasis.rst | 2 +- docs/reference/commands/shconv.rst | 2 +- docs/reference/commands/shview.rst | 2 +- docs/reference/commands/tck2connectome.rst | 2 +- docs/reference/commands/tck2fixel.rst | 2 +- docs/reference/commands/tckconvert.rst | 2 +- docs/reference/commands/tckedit.rst | 2 +- docs/reference/commands/tckgen.rst | 2 +- docs/reference/commands/tckglobal.rst | 2 +- docs/reference/commands/tckinfo.rst | 2 +- docs/reference/commands/tckmap.rst | 2 +- docs/reference/commands/tcknormalise.rst | 2 +- docs/reference/commands/tckresample.rst | 2 +- docs/reference/commands/tcksample.rst | 2 +- docs/reference/commands/tcksift.rst | 2 +- docs/reference/commands/tcksift2.rst | 2 +- docs/reference/commands/tckstats.rst | 2 +- docs/reference/commands/tensor2metric.rst | 2 +- docs/reference/commands/transformcalc.rst | 2 +- docs/reference/commands/transformcompose.rst | 2 +- docs/reference/commands/transformconvert.rst | 2 +- docs/reference/commands/tsfdivide.rst | 2 +- docs/reference/commands/tsfinfo.rst | 2 +- docs/reference/commands/tsfmult.rst | 2 +- docs/reference/commands/tsfsmooth.rst | 2 +- docs/reference/commands/tsfthreshold.rst | 2 +- docs/reference/commands/vectorstats.rst | 2 +- docs/reference/commands/voxel2fixel.rst | 2 +- docs/reference/commands/warp2metric.rst | 2 +- docs/reference/commands/warpconvert.rst | 2 +- docs/reference/commands/warpcorrect.rst | 2 +- docs/reference/commands/warpinit.rst | 2 +- 106 files changed, 106 insertions(+), 106 deletions(-) diff --git a/docs/reference/commands/5tt2gmwmi.rst b/docs/reference/commands/5tt2gmwmi.rst index 8762b219a1..be0d9bc7ff 100644 --- a/docs/reference/commands/5tt2gmwmi.rst +++ b/docs/reference/commands/5tt2gmwmi.rst @@ -28,7 +28,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/5tt2vis.rst b/docs/reference/commands/5tt2vis.rst index 0eb3b513ac..58883903a4 100644 --- a/docs/reference/commands/5tt2vis.rst +++ b/docs/reference/commands/5tt2vis.rst @@ -38,7 +38,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/5ttcheck.rst b/docs/reference/commands/5ttcheck.rst index cb76344267..ab35f2be39 100644 --- a/docs/reference/commands/5ttcheck.rst +++ b/docs/reference/commands/5ttcheck.rst @@ -27,7 +27,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/5ttedit.rst b/docs/reference/commands/5ttedit.rst index afb0c4af49..805645a5b3 100644 --- a/docs/reference/commands/5ttedit.rst +++ b/docs/reference/commands/5ttedit.rst @@ -38,7 +38,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/afdconnectivity.rst b/docs/reference/commands/afdconnectivity.rst index 3440306b5f..e67f831140 100644 --- a/docs/reference/commands/afdconnectivity.rst +++ b/docs/reference/commands/afdconnectivity.rst @@ -45,7 +45,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/amp2response.rst b/docs/reference/commands/amp2response.rst index c2f26f701f..c83ec94bd9 100644 --- a/docs/reference/commands/amp2response.rst +++ b/docs/reference/commands/amp2response.rst @@ -50,7 +50,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/amp2sh.rst b/docs/reference/commands/amp2sh.rst index 75b8def22c..1ec372d3b6 100644 --- a/docs/reference/commands/amp2sh.rst +++ b/docs/reference/commands/amp2sh.rst @@ -62,7 +62,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/connectome2tck.rst b/docs/reference/commands/connectome2tck.rst index 98fa22ecf8..2f43e0abca 100644 --- a/docs/reference/commands/connectome2tck.rst +++ b/docs/reference/commands/connectome2tck.rst @@ -54,7 +54,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/connectomestats.rst b/docs/reference/commands/connectomestats.rst index 405afd9a09..73faacfbbc 100644 --- a/docs/reference/commands/connectomestats.rst +++ b/docs/reference/commands/connectomestats.rst @@ -58,7 +58,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dcmedit.rst b/docs/reference/commands/dcmedit.rst index 54840e787b..f527ce7660 100644 --- a/docs/reference/commands/dcmedit.rst +++ b/docs/reference/commands/dcmedit.rst @@ -38,7 +38,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dcminfo.rst b/docs/reference/commands/dcminfo.rst index 67547cec73..2904b263a1 100644 --- a/docs/reference/commands/dcminfo.rst +++ b/docs/reference/commands/dcminfo.rst @@ -31,7 +31,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dirflip.rst b/docs/reference/commands/dirflip.rst index bdc556ba36..2b3c70cf4f 100644 --- a/docs/reference/commands/dirflip.rst +++ b/docs/reference/commands/dirflip.rst @@ -35,7 +35,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dirgen.rst b/docs/reference/commands/dirgen.rst index ee52425850..f3595e1334 100644 --- a/docs/reference/commands/dirgen.rst +++ b/docs/reference/commands/dirgen.rst @@ -41,7 +41,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dirmerge.rst b/docs/reference/commands/dirmerge.rst index ea00e52b90..bae1da340f 100644 --- a/docs/reference/commands/dirmerge.rst +++ b/docs/reference/commands/dirmerge.rst @@ -29,7 +29,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dirorder.rst b/docs/reference/commands/dirorder.rst index 157d0c8f43..c8c23da642 100644 --- a/docs/reference/commands/dirorder.rst +++ b/docs/reference/commands/dirorder.rst @@ -28,7 +28,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dirsplit.rst b/docs/reference/commands/dirsplit.rst index 67470857a9..506985b869 100644 --- a/docs/reference/commands/dirsplit.rst +++ b/docs/reference/commands/dirsplit.rst @@ -30,7 +30,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dirstat.rst b/docs/reference/commands/dirstat.rst index 688baf4429..935d82788d 100644 --- a/docs/reference/commands/dirstat.rst +++ b/docs/reference/commands/dirstat.rst @@ -25,7 +25,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dwi2adc.rst b/docs/reference/commands/dwi2adc.rst index 38a89ef9eb..ad5f95ba92 100644 --- a/docs/reference/commands/dwi2adc.rst +++ b/docs/reference/commands/dwi2adc.rst @@ -35,7 +35,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dwi2fod.rst b/docs/reference/commands/dwi2fod.rst index 131cc2bcf5..6aa9401ccf 100644 --- a/docs/reference/commands/dwi2fod.rst +++ b/docs/reference/commands/dwi2fod.rst @@ -73,7 +73,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dwi2mask.rst b/docs/reference/commands/dwi2mask.rst index 78e046cf62..90042643a2 100644 --- a/docs/reference/commands/dwi2mask.rst +++ b/docs/reference/commands/dwi2mask.rst @@ -44,7 +44,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dwi2noise.rst b/docs/reference/commands/dwi2noise.rst index f3983ed633..4b78c251ac 100644 --- a/docs/reference/commands/dwi2noise.rst +++ b/docs/reference/commands/dwi2noise.rst @@ -47,7 +47,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dwi2tensor.rst b/docs/reference/commands/dwi2tensor.rst index 6fbcd77680..2cf8163799 100644 --- a/docs/reference/commands/dwi2tensor.rst +++ b/docs/reference/commands/dwi2tensor.rst @@ -50,7 +50,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dwidenoise.rst b/docs/reference/commands/dwidenoise.rst index b3bf440fa6..79cb72bc87 100644 --- a/docs/reference/commands/dwidenoise.rst +++ b/docs/reference/commands/dwidenoise.rst @@ -41,7 +41,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dwiextract.rst b/docs/reference/commands/dwiextract.rst index c306294cb9..1026271570 100644 --- a/docs/reference/commands/dwiextract.rst +++ b/docs/reference/commands/dwiextract.rst @@ -63,7 +63,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dwinormalise.rst b/docs/reference/commands/dwinormalise.rst index 4fd0fb5c75..4dc3edc281 100644 --- a/docs/reference/commands/dwinormalise.rst +++ b/docs/reference/commands/dwinormalise.rst @@ -40,7 +40,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fixel2sh.rst b/docs/reference/commands/fixel2sh.rst index 9df42eb97f..b236af50f5 100644 --- a/docs/reference/commands/fixel2sh.rst +++ b/docs/reference/commands/fixel2sh.rst @@ -33,7 +33,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fixel2tsf.rst b/docs/reference/commands/fixel2tsf.rst index 6ba77a8059..f12b3d84c2 100644 --- a/docs/reference/commands/fixel2tsf.rst +++ b/docs/reference/commands/fixel2tsf.rst @@ -34,7 +34,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fixel2voxel.rst b/docs/reference/commands/fixel2voxel.rst index 784a8c6453..5fa13a299b 100644 --- a/docs/reference/commands/fixel2voxel.rst +++ b/docs/reference/commands/fixel2voxel.rst @@ -48,7 +48,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fixelcfestats.rst b/docs/reference/commands/fixelcfestats.rst index 7e8655a4bd..bafc3be5b4 100644 --- a/docs/reference/commands/fixelcfestats.rst +++ b/docs/reference/commands/fixelcfestats.rst @@ -74,7 +74,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fixelconvert.rst b/docs/reference/commands/fixelconvert.rst index 38af9e086f..b48bfc1a46 100644 --- a/docs/reference/commands/fixelconvert.rst +++ b/docs/reference/commands/fixelconvert.rst @@ -44,7 +44,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fixelcorrespondence.rst b/docs/reference/commands/fixelcorrespondence.rst index b6ee9574c7..a2fdedf264 100644 --- a/docs/reference/commands/fixelcorrespondence.rst +++ b/docs/reference/commands/fixelcorrespondence.rst @@ -35,7 +35,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fixelcrop.rst b/docs/reference/commands/fixelcrop.rst index 5032c0674c..04edca40e5 100644 --- a/docs/reference/commands/fixelcrop.rst +++ b/docs/reference/commands/fixelcrop.rst @@ -32,7 +32,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fixelreorient.rst b/docs/reference/commands/fixelreorient.rst index 800efdc5d6..e9984c951f 100644 --- a/docs/reference/commands/fixelreorient.rst +++ b/docs/reference/commands/fixelreorient.rst @@ -32,7 +32,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fod2dec.rst b/docs/reference/commands/fod2dec.rst index c489ca5755..3665563ed1 100644 --- a/docs/reference/commands/fod2dec.rst +++ b/docs/reference/commands/fod2dec.rst @@ -45,7 +45,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fod2fixel.rst b/docs/reference/commands/fod2fixel.rst index 8153b8bdbf..b95f523b0c 100644 --- a/docs/reference/commands/fod2fixel.rst +++ b/docs/reference/commands/fod2fixel.rst @@ -52,7 +52,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/label2colour.rst b/docs/reference/commands/label2colour.rst index 490499ade5..ec6946569d 100644 --- a/docs/reference/commands/label2colour.rst +++ b/docs/reference/commands/label2colour.rst @@ -33,7 +33,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/label2mesh.rst b/docs/reference/commands/label2mesh.rst index af06b5ba72..4fb6f795f8 100644 --- a/docs/reference/commands/label2mesh.rst +++ b/docs/reference/commands/label2mesh.rst @@ -28,7 +28,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/labelconvert.rst b/docs/reference/commands/labelconvert.rst index a11ba9dfe3..8194d42e0b 100644 --- a/docs/reference/commands/labelconvert.rst +++ b/docs/reference/commands/labelconvert.rst @@ -35,7 +35,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/maskdump.rst b/docs/reference/commands/maskdump.rst index b03f76f3a5..65fbfeea27 100644 --- a/docs/reference/commands/maskdump.rst +++ b/docs/reference/commands/maskdump.rst @@ -31,7 +31,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/maskfilter.rst b/docs/reference/commands/maskfilter.rst index be04679c70..c472b3d799 100644 --- a/docs/reference/commands/maskfilter.rst +++ b/docs/reference/commands/maskfilter.rst @@ -63,7 +63,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mesh2pve.rst b/docs/reference/commands/mesh2pve.rst index be95625eb3..f896589648 100644 --- a/docs/reference/commands/mesh2pve.rst +++ b/docs/reference/commands/mesh2pve.rst @@ -27,7 +27,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/meshconvert.rst b/docs/reference/commands/meshconvert.rst index 3f159609d8..e03f7b541c 100644 --- a/docs/reference/commands/meshconvert.rst +++ b/docs/reference/commands/meshconvert.rst @@ -30,7 +30,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/meshfilter.rst b/docs/reference/commands/meshfilter.rst index 28e989f19c..834425482f 100644 --- a/docs/reference/commands/meshfilter.rst +++ b/docs/reference/commands/meshfilter.rst @@ -34,7 +34,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mraverageheader.rst b/docs/reference/commands/mraverageheader.rst index e76239cd43..54bc532ef6 100644 --- a/docs/reference/commands/mraverageheader.rst +++ b/docs/reference/commands/mraverageheader.rst @@ -37,7 +37,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrcalc.rst b/docs/reference/commands/mrcalc.rst index cfd346b72e..53686cd54a 100644 --- a/docs/reference/commands/mrcalc.rst +++ b/docs/reference/commands/mrcalc.rst @@ -146,7 +146,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrcat.rst b/docs/reference/commands/mrcat.rst index 80d6b8078b..57fa1e43b9 100644 --- a/docs/reference/commands/mrcat.rst +++ b/docs/reference/commands/mrcat.rst @@ -34,7 +34,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrcheckerboardmask.rst b/docs/reference/commands/mrcheckerboardmask.rst index 2d4e19645f..4bbf284769 100644 --- a/docs/reference/commands/mrcheckerboardmask.rst +++ b/docs/reference/commands/mrcheckerboardmask.rst @@ -32,7 +32,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrclusterstats.rst b/docs/reference/commands/mrclusterstats.rst index fb86f87bfe..121c1b4723 100644 --- a/docs/reference/commands/mrclusterstats.rst +++ b/docs/reference/commands/mrclusterstats.rst @@ -62,7 +62,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrconvert.rst b/docs/reference/commands/mrconvert.rst index f3d00a8317..2409a24d1e 100644 --- a/docs/reference/commands/mrconvert.rst +++ b/docs/reference/commands/mrconvert.rst @@ -93,7 +93,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrcrop.rst b/docs/reference/commands/mrcrop.rst index a568c17f74..1ecb00e8ce 100644 --- a/docs/reference/commands/mrcrop.rst +++ b/docs/reference/commands/mrcrop.rst @@ -39,7 +39,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrdegibbs.rst b/docs/reference/commands/mrdegibbs.rst index 7a2c033cfc..82b8132f73 100644 --- a/docs/reference/commands/mrdegibbs.rst +++ b/docs/reference/commands/mrdegibbs.rst @@ -48,7 +48,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrdump.rst b/docs/reference/commands/mrdump.rst index 917fc4d9cb..ccc8af9821 100644 --- a/docs/reference/commands/mrdump.rst +++ b/docs/reference/commands/mrdump.rst @@ -33,7 +33,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mredit.rst b/docs/reference/commands/mredit.rst index 05ff54a6f1..9edadbd366 100644 --- a/docs/reference/commands/mredit.rst +++ b/docs/reference/commands/mredit.rst @@ -39,7 +39,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrfilter.rst b/docs/reference/commands/mrfilter.rst index 40c2e264ce..3c9565e90c 100644 --- a/docs/reference/commands/mrfilter.rst +++ b/docs/reference/commands/mrfilter.rst @@ -80,7 +80,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrhistmatch.rst b/docs/reference/commands/mrhistmatch.rst index ec2cce430a..bbe74766de 100644 --- a/docs/reference/commands/mrhistmatch.rst +++ b/docs/reference/commands/mrhistmatch.rst @@ -35,7 +35,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrhistogram.rst b/docs/reference/commands/mrhistogram.rst index a1600df40c..5d3f9c15b1 100644 --- a/docs/reference/commands/mrhistogram.rst +++ b/docs/reference/commands/mrhistogram.rst @@ -42,7 +42,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrinfo.rst b/docs/reference/commands/mrinfo.rst index 8180679d41..3f41ff0afe 100644 --- a/docs/reference/commands/mrinfo.rst +++ b/docs/reference/commands/mrinfo.rst @@ -93,7 +93,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrmath.rst b/docs/reference/commands/mrmath.rst index 2ce4c64cc6..8b953989fc 100644 --- a/docs/reference/commands/mrmath.rst +++ b/docs/reference/commands/mrmath.rst @@ -43,7 +43,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrmesh.rst b/docs/reference/commands/mrmesh.rst index d56c377527..f73c76cfa3 100644 --- a/docs/reference/commands/mrmesh.rst +++ b/docs/reference/commands/mrmesh.rst @@ -30,7 +30,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrmetric.rst b/docs/reference/commands/mrmetric.rst index a1b7454d7c..64dd171e83 100644 --- a/docs/reference/commands/mrmetric.rst +++ b/docs/reference/commands/mrmetric.rst @@ -45,7 +45,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrpad.rst b/docs/reference/commands/mrpad.rst index 66bd64fa7c..9884b307b6 100644 --- a/docs/reference/commands/mrpad.rst +++ b/docs/reference/commands/mrpad.rst @@ -30,7 +30,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrregister.rst b/docs/reference/commands/mrregister.rst index f622d6c5c4..7f7eb67932 100644 --- a/docs/reference/commands/mrregister.rst +++ b/docs/reference/commands/mrregister.rst @@ -166,7 +166,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrresize.rst b/docs/reference/commands/mrresize.rst index 1daaa0501a..780d6c8728 100644 --- a/docs/reference/commands/mrresize.rst +++ b/docs/reference/commands/mrresize.rst @@ -46,7 +46,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrstats.rst b/docs/reference/commands/mrstats.rst index d9277c1cc5..01faee3b71 100644 --- a/docs/reference/commands/mrstats.rst +++ b/docs/reference/commands/mrstats.rst @@ -39,7 +39,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrthreshold.rst b/docs/reference/commands/mrthreshold.rst index c985c0fb40..ecb117fbb6 100644 --- a/docs/reference/commands/mrthreshold.rst +++ b/docs/reference/commands/mrthreshold.rst @@ -51,7 +51,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrtransform.rst b/docs/reference/commands/mrtransform.rst index 6cee9b69b0..332152d475 100644 --- a/docs/reference/commands/mrtransform.rst +++ b/docs/reference/commands/mrtransform.rst @@ -95,7 +95,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrview.rst b/docs/reference/commands/mrview.rst index 2e8681565c..d1b1f8fe71 100644 --- a/docs/reference/commands/mrview.rst +++ b/docs/reference/commands/mrview.rst @@ -169,7 +169,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mtbin.rst b/docs/reference/commands/mtbin.rst index 15324d8da3..3afa638fbb 100644 --- a/docs/reference/commands/mtbin.rst +++ b/docs/reference/commands/mtbin.rst @@ -44,7 +44,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mtnormalise.rst b/docs/reference/commands/mtnormalise.rst index 4bef89ae0c..18bf5b108d 100644 --- a/docs/reference/commands/mtnormalise.rst +++ b/docs/reference/commands/mtnormalise.rst @@ -46,7 +46,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/peaks2amp.rst b/docs/reference/commands/peaks2amp.rst index f5a43cc58c..5b9a5e54cf 100644 --- a/docs/reference/commands/peaks2amp.rst +++ b/docs/reference/commands/peaks2amp.rst @@ -26,7 +26,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/sh2amp.rst b/docs/reference/commands/sh2amp.rst index 9f38807742..47ab3e9ea6 100644 --- a/docs/reference/commands/sh2amp.rst +++ b/docs/reference/commands/sh2amp.rst @@ -41,7 +41,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/sh2peaks.rst b/docs/reference/commands/sh2peaks.rst index 51fbdda760..421fa4a89e 100644 --- a/docs/reference/commands/sh2peaks.rst +++ b/docs/reference/commands/sh2peaks.rst @@ -38,7 +38,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/sh2power.rst b/docs/reference/commands/sh2power.rst index 694814542a..cf81454413 100644 --- a/docs/reference/commands/sh2power.rst +++ b/docs/reference/commands/sh2power.rst @@ -33,7 +33,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/sh2response.rst b/docs/reference/commands/sh2response.rst index f054675166..fdedd58dce 100644 --- a/docs/reference/commands/sh2response.rst +++ b/docs/reference/commands/sh2response.rst @@ -32,7 +32,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/shbasis.rst b/docs/reference/commands/shbasis.rst index 56e6318d08..32ca386524 100644 --- a/docs/reference/commands/shbasis.rst +++ b/docs/reference/commands/shbasis.rst @@ -34,7 +34,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/shconv.rst b/docs/reference/commands/shconv.rst index d4b9458ff0..3f55ba2caf 100644 --- a/docs/reference/commands/shconv.rst +++ b/docs/reference/commands/shconv.rst @@ -34,7 +34,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/shview.rst b/docs/reference/commands/shview.rst index 12c63a9523..a52546013b 100644 --- a/docs/reference/commands/shview.rst +++ b/docs/reference/commands/shview.rst @@ -27,7 +27,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tck2connectome.rst b/docs/reference/commands/tck2connectome.rst index 2b3587f308..cb014b28f3 100644 --- a/docs/reference/commands/tck2connectome.rst +++ b/docs/reference/commands/tck2connectome.rst @@ -71,7 +71,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tck2fixel.rst b/docs/reference/commands/tck2fixel.rst index 5ce37fdf68..4e3115099a 100644 --- a/docs/reference/commands/tck2fixel.rst +++ b/docs/reference/commands/tck2fixel.rst @@ -30,7 +30,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tckconvert.rst b/docs/reference/commands/tckconvert.rst index 7d738f6ac0..522979abf7 100644 --- a/docs/reference/commands/tckconvert.rst +++ b/docs/reference/commands/tckconvert.rst @@ -62,7 +62,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tckedit.rst b/docs/reference/commands/tckedit.rst index 8dc9f9b721..7598d6cfd4 100644 --- a/docs/reference/commands/tckedit.rst +++ b/docs/reference/commands/tckedit.rst @@ -77,7 +77,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tckgen.rst b/docs/reference/commands/tckgen.rst index cefee14e20..0d6ddfbf8e 100644 --- a/docs/reference/commands/tckgen.rst +++ b/docs/reference/commands/tckgen.rst @@ -139,7 +139,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tckglobal.rst b/docs/reference/commands/tckglobal.rst index 2cbace1a29..89df42eebf 100644 --- a/docs/reference/commands/tckglobal.rst +++ b/docs/reference/commands/tckglobal.rst @@ -92,7 +92,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tckinfo.rst b/docs/reference/commands/tckinfo.rst index 7e80dfe6b5..d4b9aab4ab 100644 --- a/docs/reference/commands/tckinfo.rst +++ b/docs/reference/commands/tckinfo.rst @@ -27,7 +27,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tckmap.rst b/docs/reference/commands/tckmap.rst index c7fcda461c..6d17610bdf 100644 --- a/docs/reference/commands/tckmap.rst +++ b/docs/reference/commands/tckmap.rst @@ -77,7 +77,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tcknormalise.rst b/docs/reference/commands/tcknormalise.rst index 2116dda1d9..10567b2a31 100644 --- a/docs/reference/commands/tcknormalise.rst +++ b/docs/reference/commands/tcknormalise.rst @@ -27,7 +27,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tckresample.rst b/docs/reference/commands/tckresample.rst index f8f8653591..d27d5cc749 100644 --- a/docs/reference/commands/tckresample.rst +++ b/docs/reference/commands/tckresample.rst @@ -50,7 +50,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tcksample.rst b/docs/reference/commands/tcksample.rst index 40bd426b31..8da5a12f9a 100644 --- a/docs/reference/commands/tcksample.rst +++ b/docs/reference/commands/tcksample.rst @@ -40,7 +40,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tcksift.rst b/docs/reference/commands/tcksift.rst index f14358d734..5008b8f68a 100644 --- a/docs/reference/commands/tcksift.rst +++ b/docs/reference/commands/tcksift.rst @@ -71,7 +71,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tcksift2.rst b/docs/reference/commands/tcksift2.rst index 0b64d9aef4..5fb38c8d95 100644 --- a/docs/reference/commands/tcksift2.rst +++ b/docs/reference/commands/tcksift2.rst @@ -86,7 +86,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tckstats.rst b/docs/reference/commands/tckstats.rst index 0e51938549..a3ce161101 100644 --- a/docs/reference/commands/tckstats.rst +++ b/docs/reference/commands/tckstats.rst @@ -35,7 +35,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tensor2metric.rst b/docs/reference/commands/tensor2metric.rst index 8b91023175..80f0c5c41f 100644 --- a/docs/reference/commands/tensor2metric.rst +++ b/docs/reference/commands/tensor2metric.rst @@ -49,7 +49,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/transformcalc.rst b/docs/reference/commands/transformcalc.rst index 197590287a..1495ea347a 100644 --- a/docs/reference/commands/transformcalc.rst +++ b/docs/reference/commands/transformcalc.rst @@ -62,7 +62,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/transformcompose.rst b/docs/reference/commands/transformcompose.rst index 11ad550c15..0e6933eb13 100644 --- a/docs/reference/commands/transformcompose.rst +++ b/docs/reference/commands/transformcompose.rst @@ -33,7 +33,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/transformconvert.rst b/docs/reference/commands/transformconvert.rst index 38f8b8b2f2..c77a09c649 100644 --- a/docs/reference/commands/transformconvert.rst +++ b/docs/reference/commands/transformconvert.rst @@ -32,7 +32,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tsfdivide.rst b/docs/reference/commands/tsfdivide.rst index 07d017972c..e16dff1592 100644 --- a/docs/reference/commands/tsfdivide.rst +++ b/docs/reference/commands/tsfdivide.rst @@ -27,7 +27,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tsfinfo.rst b/docs/reference/commands/tsfinfo.rst index c1a91fdd22..cf25be569c 100644 --- a/docs/reference/commands/tsfinfo.rst +++ b/docs/reference/commands/tsfinfo.rst @@ -29,7 +29,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tsfmult.rst b/docs/reference/commands/tsfmult.rst index 5d2edf8960..42cbe097ac 100644 --- a/docs/reference/commands/tsfmult.rst +++ b/docs/reference/commands/tsfmult.rst @@ -27,7 +27,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tsfsmooth.rst b/docs/reference/commands/tsfsmooth.rst index eed0c8e8e3..6570831ac8 100644 --- a/docs/reference/commands/tsfsmooth.rst +++ b/docs/reference/commands/tsfsmooth.rst @@ -28,7 +28,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tsfthreshold.rst b/docs/reference/commands/tsfthreshold.rst index 586c1e706b..c100d72c82 100644 --- a/docs/reference/commands/tsfthreshold.rst +++ b/docs/reference/commands/tsfthreshold.rst @@ -29,7 +29,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/vectorstats.rst b/docs/reference/commands/vectorstats.rst index c55361ea33..8e3732ea54 100644 --- a/docs/reference/commands/vectorstats.rst +++ b/docs/reference/commands/vectorstats.rst @@ -37,7 +37,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/voxel2fixel.rst b/docs/reference/commands/voxel2fixel.rst index afc88bfbc7..646723cd7a 100644 --- a/docs/reference/commands/voxel2fixel.rst +++ b/docs/reference/commands/voxel2fixel.rst @@ -33,7 +33,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/warp2metric.rst b/docs/reference/commands/warp2metric.rst index bfdf9926a5..ce48c9e703 100644 --- a/docs/reference/commands/warp2metric.rst +++ b/docs/reference/commands/warp2metric.rst @@ -31,7 +31,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/warpconvert.rst b/docs/reference/commands/warpconvert.rst index 4be712a41d..cd1c4a09a8 100644 --- a/docs/reference/commands/warpconvert.rst +++ b/docs/reference/commands/warpconvert.rst @@ -39,7 +39,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/warpcorrect.rst b/docs/reference/commands/warpcorrect.rst index 8eeb359cf8..8aacd7e4ca 100644 --- a/docs/reference/commands/warpcorrect.rst +++ b/docs/reference/commands/warpcorrect.rst @@ -31,7 +31,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/warpinit.rst b/docs/reference/commands/warpinit.rst index 7661664cbf..c7f37a20f4 100644 --- a/docs/reference/commands/warpinit.rst +++ b/docs/reference/commands/warpinit.rst @@ -37,7 +37,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. From e7a49bb8225a19df88fedcf40ab705d20de5b5e5 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Mon, 20 Nov 2017 10:49:33 +0000 Subject: [PATCH 228/538] GZ handling: make error message more explicit about the GZ handling --- core/file/gz.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/core/file/gz.h b/core/file/gz.h index c81c0ca807..46815a25e9 100644 --- a/core/file/gz.h +++ b/core/file/gz.h @@ -44,7 +44,7 @@ namespace MR } const std::string& name () const { - return (filename); + return filename; } void open (const std::string& fname, const char* mode) { @@ -68,15 +68,15 @@ namespace MR } bool is_open () const { - return (gz); + return gz; } bool eof () const { assert (gz); - return (gzeof (gz)); + return gzeof (gz); } int64_t tell () const { assert (gz); - return (gztell (gz)); + return gztell (gz); } int64_t tellg () const { return tell(); @@ -86,27 +86,27 @@ namespace MR assert (gz); z_off_t pos = gzseek (gz, offset, SEEK_SET); if (pos < 0) - throw Exception ("error seeking in file \"" + filename + "\": " + error()); + throw Exception ("error seeking in GZ file \"" + filename + "\": " + error()); } int read (char* s, size_t n) { assert (gz); int n_read = gzread (gz, s, n); if (n_read < 0) - throw Exception ("error reading from file \"" + filename + "\": " + error()); - return (n_read); + throw Exception ("error uncompressing GZ file \"" + filename + "\": " + error()); + return n_read; } void write (const char* s, size_t n) { assert (gz); if (gzwrite (gz, s, n) <= 0) - throw Exception ("error writing to file \"" + filename + "\": " + error()); + throw Exception ("error writing to GZ file \"" + filename + "\": " + error()); } void write (const std::string& s) { assert (gz); if (gzputs (gz, s.c_str()) < 0) - throw Exception ("error writing to file \"" + filename + "\": " + error()); + throw Exception ("error writing to GZ file \"" + filename + "\": " + error()); } std::string getline () { @@ -117,44 +117,44 @@ namespace MR c = gzgetc (gz); if (c < 0) { if (eof()) break; - throw Exception ("error reading from file \"" + filename + "\": " + error()); + throw Exception ("error uncompressing GZ file \"" + filename + "\": " + error()); } string += char (c); } while (c != '\n'); if (string.size() && (string[string.size()-1] == 015 || string[string.size()-1] == '\n')) string.resize (string.size()-1); - return (string); + return string; } template T get () { T val; if (read (&val, sizeof (T)) != sizeof (T)) - throw Exception ("error reading from file \"" + filename + "\": " + error()); - return (val); + throw Exception ("error uncompressing GZ file \"" + filename + "\": " + error()); + return val; } template T get (int64_t offset) { seek (offset); - return (get()); + return get(); } template T* get (T* buf, size_t n) { if (read (buf, n*sizeof (T)) != n*sizeof (T)) - throw Exception ("error reading from file \"" + filename + "\": " + error()); - return (buf); + throw Exception ("error uncompressing GZ file \"" + filename + "\": " + error()); + return buf; } template T* get (int64_t offset, T* buf, size_t n) { seek (offset); - return (get (buf, n)); + return get (buf, n); } protected: gzFile gz; std::string filename; - const char* error () { + const char* error () { int error_number; const char* s = gzerror (gz, &error_number); if (error_number == Z_ERRNO) s = strerror (errno); From 6b90a7f2c831fdc92c2d60927b5c64675ff64e37 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Mon, 20 Nov 2017 12:34:41 +0000 Subject: [PATCH 229/538] build: switch to core active config if module config differs This can lead to strangeness in testing otherwise. --- build | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/build b/build index f2fc83bd07..9460aaa8db 100755 --- a/build +++ b/build @@ -336,7 +336,7 @@ while os.path.abspath (os.path.dirname (get_real_name (build_script))) != os.pat # CONFIG HANDLING # ############################################################################ -def get_active_build (folder = '.'): +def get_active_build (folder): active_config = glob.glob (os.path.join (folder, 'build.*.active')) if len (active_config) > 1: sys.stderr.write ('ERROR: more than one config is currently marked as active!\n') @@ -357,7 +357,7 @@ def get_active_build (folder = '.'): def store_current_build (folder = '.'): stored_config = get_active_build (folder) os.rename (stored_config + '.active', stored_config) - print ('storing "' + stored_config + '"...') + print ('in "' + folder + '": storing "' + stored_config + '"...') for f in [ tmp_dir, 'config' ] + list_untracked_bin_files (folder) + glob.glob ('lib/libmrtrix*'): if os.path.exists (os.path.join (folder, f)): os.renames (os.path.join (folder, f), os.path.join (stored_config, f)) @@ -368,7 +368,7 @@ def restore_build (name, folder = '.'): stored_config = os.path.join (folder, 'build.' + name) active_config = stored_config + '.active' if os.path.isdir (stored_config): - print ('restoring "' + stored_config + '"...') + print ('in "' + folder + '": restoring "' + stored_config + '"...') os.rename (stored_config, active_config) for root, dirs, files in os.walk(active_config, topdown=False): for name in files: @@ -379,7 +379,7 @@ def restore_build (name, folder = '.'): else: if os.path.exists (stored_config): raise Exception ('ERROR config to be restored (' + stored_config + ') is not a folder') - print ('creating empty "' + stored_config + '"...') + print ('in "' + folder + '": creating empty "' + stored_config + '"...') if not os.path.isdir (active_config): os.mkdir (active_config) @@ -405,7 +405,7 @@ def activate_build (name, folders): if len (targets) and targets[0] == 'select': if len(targets) == 1: - active_config = os.path.basename (get_active_build ()) + active_config = os.path.basename (get_active_build ('.')) print ('current config is "' + active_config + '"') for folder in mrtrix_dir[1:]: other_config = os.path.basename (get_active_build (folder)) @@ -427,9 +427,12 @@ if len (targets) and targets[0] == 'select': -active_config = os.path.basename (get_active_build())[6:] +active_config = os.path.basename (get_active_build ('.'))[6:] log ('active config is ' + active_config + '\n\n') -activate_build (active_config, mrtrix_dir) +active_config_core = os.path.basename (get_active_build (mrtrix_dir[-1]))[6:] +if active_config_core != active_config: + print ('active config differs from core - switching to core active config') +activate_build (active_config_core, mrtrix_dir) From aa76ac8055205cab96352745404a8104a0d8bff8 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 21 Nov 2017 10:57:54 +1100 Subject: [PATCH 230/538] DICOM: Remove attempted support for CSA1 --- core/file/dicom/csa_entry.h | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/core/file/dicom/csa_entry.h b/core/file/dicom/csa_entry.h index e4983dbbcf..c46497bc27 100644 --- a/core/file/dicom/csa_entry.h +++ b/core/file/dicom/csa_entry.h @@ -32,17 +32,9 @@ namespace MR { cnum (0) { if (strncmp ("SV10", (const char*) start, 4)) { - num = Raw::fetch_LE (start); - if (num < 1 || num > 128) { - DEBUG ("WARNING: CSA1 format with invalid number of tags (" + str(num) + "); ignoring"); - cnum = num; - next = end; - } else { - const uint32_t unused = Raw::fetch_LE (start+4); - if (unused != 77) - DEBUG ("CSA1 \'unused\' integer field contains " + str(unused) + "; expected 77"); - next = start + 8; - } + DEBUG ("Siemens CSA entry does not start with \"SV10\"; ignoring"); + cnum = num = 0; + next = end; } else { const uint8_t* const unused1 = start+4; if (unused1[0] != 0x04U || unused1[1] != 0x03U || unused1[2] != 0x02U || unused1[3] != 0x01U) From e136e7f1885597c83a47605b20b1e8f7b59d9ef2 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Tue, 21 Nov 2017 15:06:00 +0000 Subject: [PATCH 231/538] TravsCI: use case statements in bash scripts --- .travis.yml | 35 ++++++++++++++++++++--------------- travis.sh | 33 ++++++++++++++++++++------------- 2 files changed, 40 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5b4ffa2c0b..002f6abcd0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -85,19 +85,24 @@ before_cache: - rm -f $HOME/.cache/pip/log/debug.log after_failure: - | - if [[ "${test}" == "sphinx" ]]; then - cat sphinx.log; - elif [[ "${test}" == "memalign" ]]; then - cat memalign.log; - elif [[ "${test}" == "pylint" ]]; then - cat pylint.log; - elif [[ "${test}" == "build" ]]; then - cat configure.log; - cat build.log; - else - cat configure.log; - cat build.log; - cat testing.log; - cat gitdiff.log; - fi + case "${test}" in + "sphinx") + cat sphinx.log + ;; + "memalign") + cat memalign.log + ; + "pylint") + cat pylint.log + ;; + "build") + cat configure.log + cat build.log + ;; + *) + cat configure.log + cat build.log + cat testing.log + cat gitdiff.log + esac - sleep 10 diff --git a/travis.sh b/travis.sh index efdf4e4dcf..a871fadded 100755 --- a/travis.sh +++ b/travis.sh @@ -4,19 +4,26 @@ set -ev # Script expects environment variables ${py} and ${test} to be set -if [ ${test} = "sphinx" ]; then - $py -m sphinx -n -N -W -w sphinx.log -c docs/ docs/ tmp/; -elif [ ${test} = "memalign" ]; then - ./check_memalign; -elif [ ${test} = "pylint" ]; then +case $test in + "sphinx") + $py -m sphinx -n -N -W -w sphinx.log -c docs/ docs/ tmp/ + ;; + "memalign") + ./check_memalign + ;; + "pylint") # Normally rely on build script to create this file - echo "__version__ = pylint_testing" > ./lib/mrtrix3/_version.py; - PYTHON=$py ./run_pylint; -elif [ ${test} = "build" ]; then - $py ./configure -nooptim && $py ./build -nowarnings; -elif [ ${test} = "run" ]; then - $py ./configure -assert && $py ./build -nowarnings && ./run_tests && ./docs/generate_user_docs.sh && git diff --exit-code docs/ > gitdiff.log; -else + echo "__version__ = pylint_testing" > ./lib/mrtrix3/_version.py + PYTHON=$py ./run_pylint + ;; + "build") + $py ./configure -nooptim && $py ./build -nowarnings + ;; + "run") + $py ./configure -assert && $py ./build -nowarnings && ./run_tests && ./docs/generate_user_docs.sh && git diff --exit-code docs/ > gitdiff.log + ;; + *) echo "Envvar \"test\" not defined"; exit 1 -fi + ;; +esac From d2e8567ba08beb787a2e0ed55086b05b53c245c5 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Tue, 21 Nov 2017 15:36:39 +0000 Subject: [PATCH 232/538] Revert "build: fix minor outstanding issues with persistent mode" This reverts commit 2be3125fd4014d2a3e5401c5b61923a1e871d16f. --- build | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build b/build index 25bc1c4aa5..846a5b2b30 100755 --- a/build +++ b/build @@ -1208,7 +1208,6 @@ except: while len(todo): stop = False - main_cindex = 0 num_todo_previous = len(todo) log (''' @@ -1237,8 +1236,7 @@ stopping despite errors as no jobs completed successfully ''') break - if len(todo): - disp (''' + disp (''' retrying as running in persistent mode ''') From 15a1e5f640d65cb48ebd8f748486af8be0a7dd51 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Tue, 21 Nov 2017 15:36:40 +0000 Subject: [PATCH 233/538] Revert "build: add persistent mode to carry on building despite errors" This reverts commit a5d5b5b72b8d68c200a4250bf6a04f429a7c3d09. --- build | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/build b/build index 846a5b2b30..f2fc83bd07 100755 --- a/build +++ b/build @@ -69,10 +69,6 @@ OPTIONS -tree [only used with -showdep] print full dependency tree for each file - - -persistent - keep trying to build regardless of failures, until none of the remaining - jobs succeed. ''' @@ -105,7 +101,6 @@ system = None dependencies = 0 dep_recursive = False verbose = False -persistent = False nowarnings = False targets = [] use_multiple_cores = True @@ -285,8 +280,6 @@ for arg in sys.argv[1:]: exit (0) elif '-verbose'.startswith(arg): verbose = True - elif '-persistent'.startswith(arg): - persistent = True elif '-nowarnings'.startswith(arg): nowarnings = True elif '-showdep'.startswith(arg): @@ -964,7 +957,6 @@ def build_next (id): target = todo[current] if target.execute(cindex, formatstr): - todo[item].currently_being_processed = False stop = 2 return @@ -1200,15 +1192,13 @@ log ('TODO list contains ' + str(len(todo)) + ''' items #for entry in todo.values(): entry.display() -try: num_processors = int(os.environ['NUMBER_OF_PROCESSORS']) -except: - try: num_processors = os.sysconf('SC_NPROCESSORS_ONLN') - except: num_processors = 1 -while len(todo): +if len(todo): - stop = False - num_todo_previous = len(todo) + try: num_processors = int(os.environ['NUMBER_OF_PROCESSORS']) + except: + try: num_processors = os.sysconf('SC_NPROCESSORS_ONLN') + except: num_processors = 1 log (''' @@ -1226,21 +1216,6 @@ while len(todo): for t in threads: t.join() - if not persistent: - break - - if len(todo) == num_todo_previous: - disp (''' -stopping despite errors as no jobs completed successfully - -''') - break - - disp (''' -retrying as running in persistent mode - -''') - # generate development-specific files (if needed) # i.e. bash completion and user documentation From c2b4ebda1ca30da676df22e6e57b7843a2de33aa Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Tue, 21 Nov 2017 16:20:25 +0000 Subject: [PATCH 234/538] mrcalc: increase tolerance on transform match test --- cmd/mrcalc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/mrcalc.cpp b/cmd/mrcalc.cpp index dc6a89c50f..df70b57756 100644 --- a/cmd/mrcalc.cpp +++ b/cmd/mrcalc.cpp @@ -585,7 +585,7 @@ void get_header (const StackEntry& entry, Header& header) for (size_t n = 0; n < std::min (header.ndim(), entry.image->ndim()); ++n) { if (header.size(n) > 1 && entry.image->size(n) > 1 && header.size(n) != entry.image->size(n)) throw Exception ("dimensions of input images do not match - aborting"); - if (!transforms_match (header, *(entry.image)) && !transform_mis_match_reported) { + if (!transforms_match (header, *(entry.image), 1.0e-4) && !transform_mis_match_reported) { WARN ("header transformations of input images do not match"); transform_mis_match_reported = true; } From d01a6373586cbdf665be8ae6001502a3e091eb5b Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Wed, 22 Nov 2017 11:13:55 +1100 Subject: [PATCH 235/538] update docs lagging behind --- docs/reference/commands/5tt2gmwmi.rst | 2 +- docs/reference/commands/5tt2vis.rst | 2 +- docs/reference/commands/5ttcheck.rst | 2 +- docs/reference/commands/5ttedit.rst | 2 +- docs/reference/commands/afdconnectivity.rst | 2 +- docs/reference/commands/amp2response.rst | 2 +- docs/reference/commands/amp2sh.rst | 2 +- docs/reference/commands/connectome2tck.rst | 2 +- docs/reference/commands/connectomestats.rst | 2 +- docs/reference/commands/dcmedit.rst | 2 +- docs/reference/commands/dcminfo.rst | 2 +- docs/reference/commands/dirflip.rst | 2 +- docs/reference/commands/dirgen.rst | 2 +- docs/reference/commands/dirmerge.rst | 2 +- docs/reference/commands/dirorder.rst | 2 +- docs/reference/commands/dirsplit.rst | 2 +- docs/reference/commands/dirstat.rst | 2 +- docs/reference/commands/dwi2adc.rst | 2 +- docs/reference/commands/dwi2fod.rst | 2 +- docs/reference/commands/dwi2mask.rst | 2 +- docs/reference/commands/dwi2noise.rst | 2 +- docs/reference/commands/dwi2tensor.rst | 2 +- docs/reference/commands/dwidenoise.rst | 2 +- docs/reference/commands/dwiextract.rst | 2 +- docs/reference/commands/dwinormalise.rst | 2 +- docs/reference/commands/fixel2sh.rst | 2 +- docs/reference/commands/fixel2tsf.rst | 2 +- docs/reference/commands/fixel2voxel.rst | 2 +- docs/reference/commands/fixelcfestats.rst | 2 +- docs/reference/commands/fixelconvert.rst | 2 +- docs/reference/commands/fixelcorrespondence.rst | 2 +- docs/reference/commands/fixelcrop.rst | 2 +- docs/reference/commands/fixelreorient.rst | 2 +- docs/reference/commands/fod2dec.rst | 2 +- docs/reference/commands/fod2fixel.rst | 2 +- docs/reference/commands/label2colour.rst | 2 +- docs/reference/commands/label2mesh.rst | 2 +- docs/reference/commands/labelconvert.rst | 2 +- docs/reference/commands/maskdump.rst | 2 +- docs/reference/commands/maskfilter.rst | 2 +- docs/reference/commands/mesh2pve.rst | 2 +- docs/reference/commands/meshconvert.rst | 2 +- docs/reference/commands/meshfilter.rst | 2 +- docs/reference/commands/mraverageheader.rst | 2 +- docs/reference/commands/mrcalc.rst | 2 +- docs/reference/commands/mrcat.rst | 2 +- docs/reference/commands/mrcheckerboardmask.rst | 2 +- docs/reference/commands/mrclusterstats.rst | 2 +- docs/reference/commands/mrconvert.rst | 2 +- docs/reference/commands/mrcrop.rst | 2 +- docs/reference/commands/mrdegibbs.rst | 2 +- docs/reference/commands/mrdump.rst | 2 +- docs/reference/commands/mredit.rst | 2 +- docs/reference/commands/mrfilter.rst | 2 +- docs/reference/commands/mrhistmatch.rst | 2 +- docs/reference/commands/mrhistogram.rst | 2 +- docs/reference/commands/mrinfo.rst | 2 +- docs/reference/commands/mrmath.rst | 2 +- docs/reference/commands/mrmesh.rst | 2 +- docs/reference/commands/mrmetric.rst | 2 +- docs/reference/commands/mrpad.rst | 2 +- docs/reference/commands/mrregister.rst | 2 +- docs/reference/commands/mrresize.rst | 2 +- docs/reference/commands/mrstats.rst | 2 +- docs/reference/commands/mrthreshold.rst | 2 +- docs/reference/commands/mrtransform.rst | 2 +- docs/reference/commands/mrview.rst | 2 +- docs/reference/commands/mtbin.rst | 2 +- docs/reference/commands/mtnormalise.rst | 2 +- docs/reference/commands/peaks2amp.rst | 2 +- docs/reference/commands/sh2amp.rst | 2 +- docs/reference/commands/sh2peaks.rst | 2 +- docs/reference/commands/sh2power.rst | 2 +- docs/reference/commands/sh2response.rst | 2 +- docs/reference/commands/shbasis.rst | 2 +- docs/reference/commands/shconv.rst | 2 +- docs/reference/commands/shview.rst | 2 +- docs/reference/commands/tck2connectome.rst | 2 +- docs/reference/commands/tck2fixel.rst | 2 +- docs/reference/commands/tckconvert.rst | 2 +- docs/reference/commands/tckdfc.rst | 2 +- docs/reference/commands/tckedit.rst | 2 +- docs/reference/commands/tckgen.rst | 2 +- docs/reference/commands/tckglobal.rst | 2 +- docs/reference/commands/tckinfo.rst | 2 +- docs/reference/commands/tckmap.rst | 2 +- docs/reference/commands/tcknormalise.rst | 2 +- docs/reference/commands/tckresample.rst | 2 +- docs/reference/commands/tcksample.rst | 2 +- docs/reference/commands/tcksift.rst | 2 +- docs/reference/commands/tcksift2.rst | 2 +- docs/reference/commands/tckstats.rst | 2 +- docs/reference/commands/tensor2metric.rst | 2 +- docs/reference/commands/transformcalc.rst | 2 +- docs/reference/commands/transformcompose.rst | 2 +- docs/reference/commands/transformconvert.rst | 2 +- docs/reference/commands/tsfdivide.rst | 2 +- docs/reference/commands/tsfinfo.rst | 2 +- docs/reference/commands/tsfmult.rst | 2 +- docs/reference/commands/tsfsmooth.rst | 2 +- docs/reference/commands/tsfthreshold.rst | 2 +- docs/reference/commands/vectorstats.rst | 2 +- docs/reference/commands/voxel2fixel.rst | 2 +- docs/reference/commands/warp2metric.rst | 2 +- docs/reference/commands/warpconvert.rst | 2 +- docs/reference/commands/warpcorrect.rst | 2 +- docs/reference/commands/warpinit.rst | 2 +- docs/reference/commands/warpinvert.rst | 2 +- docs/reference/commands_list.rst | 4 ++-- 109 files changed, 110 insertions(+), 110 deletions(-) diff --git a/docs/reference/commands/5tt2gmwmi.rst b/docs/reference/commands/5tt2gmwmi.rst index 5293511ea4..068ea14d0d 100644 --- a/docs/reference/commands/5tt2gmwmi.rst +++ b/docs/reference/commands/5tt2gmwmi.rst @@ -28,7 +28,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/5tt2vis.rst b/docs/reference/commands/5tt2vis.rst index 14ec02ad68..2065b405b2 100644 --- a/docs/reference/commands/5tt2vis.rst +++ b/docs/reference/commands/5tt2vis.rst @@ -38,7 +38,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/5ttcheck.rst b/docs/reference/commands/5ttcheck.rst index 47032c8d69..768e5a681e 100644 --- a/docs/reference/commands/5ttcheck.rst +++ b/docs/reference/commands/5ttcheck.rst @@ -27,7 +27,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/5ttedit.rst b/docs/reference/commands/5ttedit.rst index d48e179d70..ef0326ad47 100644 --- a/docs/reference/commands/5ttedit.rst +++ b/docs/reference/commands/5ttedit.rst @@ -38,7 +38,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/afdconnectivity.rst b/docs/reference/commands/afdconnectivity.rst index a4064f8f70..fe2d48db4e 100644 --- a/docs/reference/commands/afdconnectivity.rst +++ b/docs/reference/commands/afdconnectivity.rst @@ -45,7 +45,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/amp2response.rst b/docs/reference/commands/amp2response.rst index c6801a0677..e0d4ded4bb 100644 --- a/docs/reference/commands/amp2response.rst +++ b/docs/reference/commands/amp2response.rst @@ -50,7 +50,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/amp2sh.rst b/docs/reference/commands/amp2sh.rst index 3b64abae63..aaf82c8804 100644 --- a/docs/reference/commands/amp2sh.rst +++ b/docs/reference/commands/amp2sh.rst @@ -62,7 +62,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/connectome2tck.rst b/docs/reference/commands/connectome2tck.rst index 02cc615d7d..5b84b2ddc3 100644 --- a/docs/reference/commands/connectome2tck.rst +++ b/docs/reference/commands/connectome2tck.rst @@ -54,7 +54,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/connectomestats.rst b/docs/reference/commands/connectomestats.rst index 551f0bf389..b98666d10c 100644 --- a/docs/reference/commands/connectomestats.rst +++ b/docs/reference/commands/connectomestats.rst @@ -58,7 +58,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dcmedit.rst b/docs/reference/commands/dcmedit.rst index a12ccee4c8..a9c2e332d1 100644 --- a/docs/reference/commands/dcmedit.rst +++ b/docs/reference/commands/dcmedit.rst @@ -38,7 +38,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dcminfo.rst b/docs/reference/commands/dcminfo.rst index 9c182ceb3b..973508d1c0 100644 --- a/docs/reference/commands/dcminfo.rst +++ b/docs/reference/commands/dcminfo.rst @@ -31,7 +31,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dirflip.rst b/docs/reference/commands/dirflip.rst index 3d4da12573..289bcae090 100644 --- a/docs/reference/commands/dirflip.rst +++ b/docs/reference/commands/dirflip.rst @@ -35,7 +35,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dirgen.rst b/docs/reference/commands/dirgen.rst index 06485af21f..dfb4c60377 100644 --- a/docs/reference/commands/dirgen.rst +++ b/docs/reference/commands/dirgen.rst @@ -41,7 +41,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dirmerge.rst b/docs/reference/commands/dirmerge.rst index b2ecdd1612..e2787ce8ed 100644 --- a/docs/reference/commands/dirmerge.rst +++ b/docs/reference/commands/dirmerge.rst @@ -29,7 +29,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dirorder.rst b/docs/reference/commands/dirorder.rst index 4715a2d41c..8a91a1e38d 100644 --- a/docs/reference/commands/dirorder.rst +++ b/docs/reference/commands/dirorder.rst @@ -28,7 +28,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dirsplit.rst b/docs/reference/commands/dirsplit.rst index 1838542f04..7be0cf5d00 100644 --- a/docs/reference/commands/dirsplit.rst +++ b/docs/reference/commands/dirsplit.rst @@ -30,7 +30,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dirstat.rst b/docs/reference/commands/dirstat.rst index 8c4a986f1b..ea2ccc69a5 100644 --- a/docs/reference/commands/dirstat.rst +++ b/docs/reference/commands/dirstat.rst @@ -64,7 +64,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dwi2adc.rst b/docs/reference/commands/dwi2adc.rst index 8092e68789..a43c50f2ed 100644 --- a/docs/reference/commands/dwi2adc.rst +++ b/docs/reference/commands/dwi2adc.rst @@ -35,7 +35,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dwi2fod.rst b/docs/reference/commands/dwi2fod.rst index 7b686546fe..e96219aa14 100644 --- a/docs/reference/commands/dwi2fod.rst +++ b/docs/reference/commands/dwi2fod.rst @@ -73,7 +73,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dwi2mask.rst b/docs/reference/commands/dwi2mask.rst index 919b9027a9..863e02aced 100644 --- a/docs/reference/commands/dwi2mask.rst +++ b/docs/reference/commands/dwi2mask.rst @@ -44,7 +44,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dwi2noise.rst b/docs/reference/commands/dwi2noise.rst index 328a50d479..a5bdc2451e 100644 --- a/docs/reference/commands/dwi2noise.rst +++ b/docs/reference/commands/dwi2noise.rst @@ -47,7 +47,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dwi2tensor.rst b/docs/reference/commands/dwi2tensor.rst index f442e6dd2b..bb59a99ea2 100644 --- a/docs/reference/commands/dwi2tensor.rst +++ b/docs/reference/commands/dwi2tensor.rst @@ -50,7 +50,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dwidenoise.rst b/docs/reference/commands/dwidenoise.rst index bdb96f897f..04d4449df8 100644 --- a/docs/reference/commands/dwidenoise.rst +++ b/docs/reference/commands/dwidenoise.rst @@ -41,7 +41,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dwiextract.rst b/docs/reference/commands/dwiextract.rst index 9477e90ba1..c7f668377e 100644 --- a/docs/reference/commands/dwiextract.rst +++ b/docs/reference/commands/dwiextract.rst @@ -63,7 +63,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/dwinormalise.rst b/docs/reference/commands/dwinormalise.rst index 2d722cb864..49a620267d 100644 --- a/docs/reference/commands/dwinormalise.rst +++ b/docs/reference/commands/dwinormalise.rst @@ -40,7 +40,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fixel2sh.rst b/docs/reference/commands/fixel2sh.rst index 4e030dacb3..843abc7f9b 100644 --- a/docs/reference/commands/fixel2sh.rst +++ b/docs/reference/commands/fixel2sh.rst @@ -33,7 +33,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fixel2tsf.rst b/docs/reference/commands/fixel2tsf.rst index f9ebda145f..42e5008ee7 100644 --- a/docs/reference/commands/fixel2tsf.rst +++ b/docs/reference/commands/fixel2tsf.rst @@ -34,7 +34,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fixel2voxel.rst b/docs/reference/commands/fixel2voxel.rst index 2d129fb147..50dfee4b1e 100644 --- a/docs/reference/commands/fixel2voxel.rst +++ b/docs/reference/commands/fixel2voxel.rst @@ -48,7 +48,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fixelcfestats.rst b/docs/reference/commands/fixelcfestats.rst index 4b6faa40cc..cb576dc456 100644 --- a/docs/reference/commands/fixelcfestats.rst +++ b/docs/reference/commands/fixelcfestats.rst @@ -74,7 +74,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fixelconvert.rst b/docs/reference/commands/fixelconvert.rst index 739afad4d3..82ea994eba 100644 --- a/docs/reference/commands/fixelconvert.rst +++ b/docs/reference/commands/fixelconvert.rst @@ -44,7 +44,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fixelcorrespondence.rst b/docs/reference/commands/fixelcorrespondence.rst index afbb47f2fd..b889aa6e0d 100644 --- a/docs/reference/commands/fixelcorrespondence.rst +++ b/docs/reference/commands/fixelcorrespondence.rst @@ -35,7 +35,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fixelcrop.rst b/docs/reference/commands/fixelcrop.rst index 642d45d5eb..ab83acc6e2 100644 --- a/docs/reference/commands/fixelcrop.rst +++ b/docs/reference/commands/fixelcrop.rst @@ -32,7 +32,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fixelreorient.rst b/docs/reference/commands/fixelreorient.rst index a68580c324..09e6c69e9e 100644 --- a/docs/reference/commands/fixelreorient.rst +++ b/docs/reference/commands/fixelreorient.rst @@ -32,7 +32,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fod2dec.rst b/docs/reference/commands/fod2dec.rst index a4fc3bd746..3cee7dbdc5 100644 --- a/docs/reference/commands/fod2dec.rst +++ b/docs/reference/commands/fod2dec.rst @@ -45,7 +45,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/fod2fixel.rst b/docs/reference/commands/fod2fixel.rst index c462023677..22e0812526 100644 --- a/docs/reference/commands/fod2fixel.rst +++ b/docs/reference/commands/fod2fixel.rst @@ -57,7 +57,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/label2colour.rst b/docs/reference/commands/label2colour.rst index 517793770b..10a3d6a9e9 100644 --- a/docs/reference/commands/label2colour.rst +++ b/docs/reference/commands/label2colour.rst @@ -33,7 +33,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/label2mesh.rst b/docs/reference/commands/label2mesh.rst index b3a63dbb08..31cae3dc54 100644 --- a/docs/reference/commands/label2mesh.rst +++ b/docs/reference/commands/label2mesh.rst @@ -28,7 +28,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/labelconvert.rst b/docs/reference/commands/labelconvert.rst index f501deddef..590aa08b40 100644 --- a/docs/reference/commands/labelconvert.rst +++ b/docs/reference/commands/labelconvert.rst @@ -35,7 +35,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/maskdump.rst b/docs/reference/commands/maskdump.rst index dcb2524da9..9336abb766 100644 --- a/docs/reference/commands/maskdump.rst +++ b/docs/reference/commands/maskdump.rst @@ -31,7 +31,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/maskfilter.rst b/docs/reference/commands/maskfilter.rst index 3b3c247d49..fc46ba9232 100644 --- a/docs/reference/commands/maskfilter.rst +++ b/docs/reference/commands/maskfilter.rst @@ -63,7 +63,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mesh2pve.rst b/docs/reference/commands/mesh2pve.rst index 49873b42a7..d62cd2eb5c 100644 --- a/docs/reference/commands/mesh2pve.rst +++ b/docs/reference/commands/mesh2pve.rst @@ -27,7 +27,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/meshconvert.rst b/docs/reference/commands/meshconvert.rst index 214b63addd..b05bc861c8 100644 --- a/docs/reference/commands/meshconvert.rst +++ b/docs/reference/commands/meshconvert.rst @@ -30,7 +30,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/meshfilter.rst b/docs/reference/commands/meshfilter.rst index 2992fa9432..3a718eeb48 100644 --- a/docs/reference/commands/meshfilter.rst +++ b/docs/reference/commands/meshfilter.rst @@ -34,7 +34,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mraverageheader.rst b/docs/reference/commands/mraverageheader.rst index 03d20d0928..d71192b624 100644 --- a/docs/reference/commands/mraverageheader.rst +++ b/docs/reference/commands/mraverageheader.rst @@ -37,7 +37,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrcalc.rst b/docs/reference/commands/mrcalc.rst index 415b8c6d30..e1d9ccbc19 100644 --- a/docs/reference/commands/mrcalc.rst +++ b/docs/reference/commands/mrcalc.rst @@ -148,7 +148,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrcat.rst b/docs/reference/commands/mrcat.rst index f382bbb1b0..be682e2fec 100644 --- a/docs/reference/commands/mrcat.rst +++ b/docs/reference/commands/mrcat.rst @@ -34,7 +34,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrcheckerboardmask.rst b/docs/reference/commands/mrcheckerboardmask.rst index 06bb4f21cc..f51851428c 100644 --- a/docs/reference/commands/mrcheckerboardmask.rst +++ b/docs/reference/commands/mrcheckerboardmask.rst @@ -32,7 +32,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrclusterstats.rst b/docs/reference/commands/mrclusterstats.rst index 6f80ec2a1f..9987c1eb31 100644 --- a/docs/reference/commands/mrclusterstats.rst +++ b/docs/reference/commands/mrclusterstats.rst @@ -62,7 +62,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrconvert.rst b/docs/reference/commands/mrconvert.rst index 975e25f2dd..2c54b72806 100644 --- a/docs/reference/commands/mrconvert.rst +++ b/docs/reference/commands/mrconvert.rst @@ -110,7 +110,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrcrop.rst b/docs/reference/commands/mrcrop.rst index 18a5f3c0d5..cf7d17d025 100644 --- a/docs/reference/commands/mrcrop.rst +++ b/docs/reference/commands/mrcrop.rst @@ -39,7 +39,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrdegibbs.rst b/docs/reference/commands/mrdegibbs.rst index a2037e0d04..31dfa88026 100644 --- a/docs/reference/commands/mrdegibbs.rst +++ b/docs/reference/commands/mrdegibbs.rst @@ -48,7 +48,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrdump.rst b/docs/reference/commands/mrdump.rst index 2865b7e387..9b5317e143 100644 --- a/docs/reference/commands/mrdump.rst +++ b/docs/reference/commands/mrdump.rst @@ -33,7 +33,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mredit.rst b/docs/reference/commands/mredit.rst index 525224fda6..44993ad4f6 100644 --- a/docs/reference/commands/mredit.rst +++ b/docs/reference/commands/mredit.rst @@ -39,7 +39,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrfilter.rst b/docs/reference/commands/mrfilter.rst index c1c8045da6..2d75c484fa 100644 --- a/docs/reference/commands/mrfilter.rst +++ b/docs/reference/commands/mrfilter.rst @@ -80,7 +80,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrhistmatch.rst b/docs/reference/commands/mrhistmatch.rst index 8b1a75f47f..c620a0719b 100644 --- a/docs/reference/commands/mrhistmatch.rst +++ b/docs/reference/commands/mrhistmatch.rst @@ -35,7 +35,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrhistogram.rst b/docs/reference/commands/mrhistogram.rst index 82e7832c55..4827481dd5 100644 --- a/docs/reference/commands/mrhistogram.rst +++ b/docs/reference/commands/mrhistogram.rst @@ -42,7 +42,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrinfo.rst b/docs/reference/commands/mrinfo.rst index e6a3c7ae56..f01974848b 100644 --- a/docs/reference/commands/mrinfo.rst +++ b/docs/reference/commands/mrinfo.rst @@ -98,7 +98,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrmath.rst b/docs/reference/commands/mrmath.rst index 25d77478c5..18924ae4fd 100644 --- a/docs/reference/commands/mrmath.rst +++ b/docs/reference/commands/mrmath.rst @@ -43,7 +43,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrmesh.rst b/docs/reference/commands/mrmesh.rst index b6b38ec7df..232f47cfee 100644 --- a/docs/reference/commands/mrmesh.rst +++ b/docs/reference/commands/mrmesh.rst @@ -30,7 +30,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrmetric.rst b/docs/reference/commands/mrmetric.rst index bcede4c5eb..013b0802af 100644 --- a/docs/reference/commands/mrmetric.rst +++ b/docs/reference/commands/mrmetric.rst @@ -45,7 +45,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrpad.rst b/docs/reference/commands/mrpad.rst index e03fa0f5ad..976274b06b 100644 --- a/docs/reference/commands/mrpad.rst +++ b/docs/reference/commands/mrpad.rst @@ -30,7 +30,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrregister.rst b/docs/reference/commands/mrregister.rst index ed8e1fa8dc..d4f50253db 100644 --- a/docs/reference/commands/mrregister.rst +++ b/docs/reference/commands/mrregister.rst @@ -166,7 +166,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrresize.rst b/docs/reference/commands/mrresize.rst index dad1faed04..fd61a4c27b 100644 --- a/docs/reference/commands/mrresize.rst +++ b/docs/reference/commands/mrresize.rst @@ -46,7 +46,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrstats.rst b/docs/reference/commands/mrstats.rst index de942c4454..22033f5423 100644 --- a/docs/reference/commands/mrstats.rst +++ b/docs/reference/commands/mrstats.rst @@ -39,7 +39,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrthreshold.rst b/docs/reference/commands/mrthreshold.rst index 2ddbf0b6a7..a23fd978a6 100644 --- a/docs/reference/commands/mrthreshold.rst +++ b/docs/reference/commands/mrthreshold.rst @@ -51,7 +51,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrtransform.rst b/docs/reference/commands/mrtransform.rst index d4024ea165..01b712c10c 100644 --- a/docs/reference/commands/mrtransform.rst +++ b/docs/reference/commands/mrtransform.rst @@ -95,7 +95,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mrview.rst b/docs/reference/commands/mrview.rst index 6490fe771f..6a8677168a 100644 --- a/docs/reference/commands/mrview.rst +++ b/docs/reference/commands/mrview.rst @@ -171,7 +171,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mtbin.rst b/docs/reference/commands/mtbin.rst index fdc8401120..6602cffd01 100644 --- a/docs/reference/commands/mtbin.rst +++ b/docs/reference/commands/mtbin.rst @@ -44,7 +44,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/mtnormalise.rst b/docs/reference/commands/mtnormalise.rst index 95e4fd2da2..8c0cb1a956 100644 --- a/docs/reference/commands/mtnormalise.rst +++ b/docs/reference/commands/mtnormalise.rst @@ -46,7 +46,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/peaks2amp.rst b/docs/reference/commands/peaks2amp.rst index 8c2f26acfa..4bc79400e0 100644 --- a/docs/reference/commands/peaks2amp.rst +++ b/docs/reference/commands/peaks2amp.rst @@ -26,7 +26,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/sh2amp.rst b/docs/reference/commands/sh2amp.rst index a78024b66a..b189510360 100644 --- a/docs/reference/commands/sh2amp.rst +++ b/docs/reference/commands/sh2amp.rst @@ -41,7 +41,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/sh2peaks.rst b/docs/reference/commands/sh2peaks.rst index 199a9e344c..28de1883e6 100644 --- a/docs/reference/commands/sh2peaks.rst +++ b/docs/reference/commands/sh2peaks.rst @@ -38,7 +38,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/sh2power.rst b/docs/reference/commands/sh2power.rst index aa114d303d..56184f818a 100644 --- a/docs/reference/commands/sh2power.rst +++ b/docs/reference/commands/sh2power.rst @@ -33,7 +33,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/sh2response.rst b/docs/reference/commands/sh2response.rst index d3d93c12d1..888af2553d 100644 --- a/docs/reference/commands/sh2response.rst +++ b/docs/reference/commands/sh2response.rst @@ -32,7 +32,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/shbasis.rst b/docs/reference/commands/shbasis.rst index 4c95ada87e..6833434e42 100644 --- a/docs/reference/commands/shbasis.rst +++ b/docs/reference/commands/shbasis.rst @@ -34,7 +34,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/shconv.rst b/docs/reference/commands/shconv.rst index dd587e19cf..b85660ec54 100644 --- a/docs/reference/commands/shconv.rst +++ b/docs/reference/commands/shconv.rst @@ -34,7 +34,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/shview.rst b/docs/reference/commands/shview.rst index 01f8171278..cc0abf5513 100644 --- a/docs/reference/commands/shview.rst +++ b/docs/reference/commands/shview.rst @@ -27,7 +27,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tck2connectome.rst b/docs/reference/commands/tck2connectome.rst index 8a0a0b1fa1..d2a2e623be 100644 --- a/docs/reference/commands/tck2connectome.rst +++ b/docs/reference/commands/tck2connectome.rst @@ -71,7 +71,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tck2fixel.rst b/docs/reference/commands/tck2fixel.rst index fe72638ef2..2f18b7fcd4 100644 --- a/docs/reference/commands/tck2fixel.rst +++ b/docs/reference/commands/tck2fixel.rst @@ -30,7 +30,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tckconvert.rst b/docs/reference/commands/tckconvert.rst index 83005b68d6..eece80a228 100644 --- a/docs/reference/commands/tckconvert.rst +++ b/docs/reference/commands/tckconvert.rst @@ -62,7 +62,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tckdfc.rst b/docs/reference/commands/tckdfc.rst index 627b4dba89..a4e6d0a00e 100644 --- a/docs/reference/commands/tckdfc.rst +++ b/docs/reference/commands/tckdfc.rst @@ -63,7 +63,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tckedit.rst b/docs/reference/commands/tckedit.rst index 732f310a86..7b17a89cd9 100644 --- a/docs/reference/commands/tckedit.rst +++ b/docs/reference/commands/tckedit.rst @@ -77,7 +77,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tckgen.rst b/docs/reference/commands/tckgen.rst index 4dcd7bd144..0a3b74438b 100644 --- a/docs/reference/commands/tckgen.rst +++ b/docs/reference/commands/tckgen.rst @@ -142,7 +142,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tckglobal.rst b/docs/reference/commands/tckglobal.rst index 88dec19462..f72adf5b88 100644 --- a/docs/reference/commands/tckglobal.rst +++ b/docs/reference/commands/tckglobal.rst @@ -92,7 +92,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tckinfo.rst b/docs/reference/commands/tckinfo.rst index 68fd589b70..b5920e5490 100644 --- a/docs/reference/commands/tckinfo.rst +++ b/docs/reference/commands/tckinfo.rst @@ -27,7 +27,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tckmap.rst b/docs/reference/commands/tckmap.rst index f8227a71e3..9993394a30 100644 --- a/docs/reference/commands/tckmap.rst +++ b/docs/reference/commands/tckmap.rst @@ -79,7 +79,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tcknormalise.rst b/docs/reference/commands/tcknormalise.rst index 67cafcdd1e..122e403bcd 100644 --- a/docs/reference/commands/tcknormalise.rst +++ b/docs/reference/commands/tcknormalise.rst @@ -27,7 +27,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tckresample.rst b/docs/reference/commands/tckresample.rst index 557f5e1a25..ddba279359 100644 --- a/docs/reference/commands/tckresample.rst +++ b/docs/reference/commands/tckresample.rst @@ -50,7 +50,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tcksample.rst b/docs/reference/commands/tcksample.rst index 9a46fd71d9..6f52525347 100644 --- a/docs/reference/commands/tcksample.rst +++ b/docs/reference/commands/tcksample.rst @@ -40,7 +40,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tcksift.rst b/docs/reference/commands/tcksift.rst index 36628e3cb5..4ecec2fcd5 100644 --- a/docs/reference/commands/tcksift.rst +++ b/docs/reference/commands/tcksift.rst @@ -71,7 +71,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tcksift2.rst b/docs/reference/commands/tcksift2.rst index 01c31feab4..4c946beb3c 100644 --- a/docs/reference/commands/tcksift2.rst +++ b/docs/reference/commands/tcksift2.rst @@ -86,7 +86,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tckstats.rst b/docs/reference/commands/tckstats.rst index 6089aa3a9d..a845e15610 100644 --- a/docs/reference/commands/tckstats.rst +++ b/docs/reference/commands/tckstats.rst @@ -35,7 +35,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tensor2metric.rst b/docs/reference/commands/tensor2metric.rst index 7c2f7af181..4abaf6a0f3 100644 --- a/docs/reference/commands/tensor2metric.rst +++ b/docs/reference/commands/tensor2metric.rst @@ -49,7 +49,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/transformcalc.rst b/docs/reference/commands/transformcalc.rst index b060fdae52..bb1233006c 100644 --- a/docs/reference/commands/transformcalc.rst +++ b/docs/reference/commands/transformcalc.rst @@ -62,7 +62,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/transformcompose.rst b/docs/reference/commands/transformcompose.rst index 904d6f5efc..afbbbdfc87 100644 --- a/docs/reference/commands/transformcompose.rst +++ b/docs/reference/commands/transformcompose.rst @@ -33,7 +33,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/transformconvert.rst b/docs/reference/commands/transformconvert.rst index ee99e1517f..407762c625 100644 --- a/docs/reference/commands/transformconvert.rst +++ b/docs/reference/commands/transformconvert.rst @@ -32,7 +32,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tsfdivide.rst b/docs/reference/commands/tsfdivide.rst index d295c239f4..2553ab3f88 100644 --- a/docs/reference/commands/tsfdivide.rst +++ b/docs/reference/commands/tsfdivide.rst @@ -27,7 +27,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tsfinfo.rst b/docs/reference/commands/tsfinfo.rst index 1c7422e61a..0339c2e6a5 100644 --- a/docs/reference/commands/tsfinfo.rst +++ b/docs/reference/commands/tsfinfo.rst @@ -29,7 +29,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tsfmult.rst b/docs/reference/commands/tsfmult.rst index 0b9042d554..8abea49eb4 100644 --- a/docs/reference/commands/tsfmult.rst +++ b/docs/reference/commands/tsfmult.rst @@ -27,7 +27,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tsfsmooth.rst b/docs/reference/commands/tsfsmooth.rst index 62642579e3..96ca3027ab 100644 --- a/docs/reference/commands/tsfsmooth.rst +++ b/docs/reference/commands/tsfsmooth.rst @@ -28,7 +28,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/tsfthreshold.rst b/docs/reference/commands/tsfthreshold.rst index 7245ac41c1..f4311390a7 100644 --- a/docs/reference/commands/tsfthreshold.rst +++ b/docs/reference/commands/tsfthreshold.rst @@ -29,7 +29,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/vectorstats.rst b/docs/reference/commands/vectorstats.rst index 5ff75869cf..89f74fc11b 100644 --- a/docs/reference/commands/vectorstats.rst +++ b/docs/reference/commands/vectorstats.rst @@ -37,7 +37,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/voxel2fixel.rst b/docs/reference/commands/voxel2fixel.rst index 122b43bc41..838128ba8b 100644 --- a/docs/reference/commands/voxel2fixel.rst +++ b/docs/reference/commands/voxel2fixel.rst @@ -33,7 +33,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/warp2metric.rst b/docs/reference/commands/warp2metric.rst index bbeb3e1eeb..d70234d216 100644 --- a/docs/reference/commands/warp2metric.rst +++ b/docs/reference/commands/warp2metric.rst @@ -31,7 +31,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/warpconvert.rst b/docs/reference/commands/warpconvert.rst index 6f73b64f77..d01957bea2 100644 --- a/docs/reference/commands/warpconvert.rst +++ b/docs/reference/commands/warpconvert.rst @@ -38,7 +38,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/warpcorrect.rst b/docs/reference/commands/warpcorrect.rst index 40feaed2f2..c0c680cd52 100644 --- a/docs/reference/commands/warpcorrect.rst +++ b/docs/reference/commands/warpcorrect.rst @@ -31,7 +31,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/warpinit.rst b/docs/reference/commands/warpinit.rst index 48faea4cec..2cc6e45939 100644 --- a/docs/reference/commands/warpinit.rst +++ b/docs/reference/commands/warpinit.rst @@ -37,7 +37,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands/warpinvert.rst b/docs/reference/commands/warpinvert.rst index 8aace8123d..4a587581ce 100644 --- a/docs/reference/commands/warpinvert.rst +++ b/docs/reference/commands/warpinvert.rst @@ -35,7 +35,7 @@ Standard options - **-info** display information messages. -- **-quiet** do not display information messages or progress status. +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - **-debug** display debugging messages. diff --git a/docs/reference/commands_list.rst b/docs/reference/commands_list.rst index 72c668e989..2525cd621c 100644 --- a/docs/reference/commands_list.rst +++ b/docs/reference/commands_list.rst @@ -100,8 +100,8 @@ List of MRtrix3 commands commands/tcknormalise commands/tckresample commands/tcksample - commands/tcksift commands/tcksift2 + commands/tcksift commands/tckstats commands/tensor2metric commands/transformcalc @@ -213,8 +213,8 @@ List of MRtrix3 commands :ref:`tcknormalise`, "Apply a normalisation map to a tracks file" :ref:`tckresample`, "Resample each streamline in a track file to a new set of vertices" :ref:`tcksample`, "Sample values of an associated image along tracks" - :ref:`tcksift`, "Filter a whole-brain fibre-tracking data set such that the streamline densities match the FOD lobe integrals" :ref:`tcksift2`, "Successor to the SIFT method; instead of removing streamlines, use an EM framework to find an appropriate cross-section multiplier for each streamline" + :ref:`tcksift`, "Filter a whole-brain fibre-tracking data set such that the streamline densities match the FOD lobe integrals" :ref:`tckstats`, "Calculate statistics on streamlines length" :ref:`tensor2metric`, "Generate maps of tensor-derived parameters" :ref:`transformcalc`, "Perform calculations on linear transformation matrices" From 31cf785a908bbc03ed0f8a459215bd4ce031bb06 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Sat, 25 Nov 2017 20:00:23 +1100 Subject: [PATCH 236/538] .travis.yml: Correct double semi-colon --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 002f6abcd0..dfdc2c9c8e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -91,7 +91,7 @@ after_failure: ;; "memalign") cat memalign.log - ; + ;; "pylint") cat pylint.log ;; From 76c57f736c17c97bd9ced62e6fa7bdcf11c8f22f Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Mon, 27 Nov 2017 16:56:51 +0000 Subject: [PATCH 237/538] transform_match(): use difference in bounding box positions as discussed in #1199 --- core/image_helpers.h | 133 ++++++++++++++++++++++--------------------- 1 file changed, 69 insertions(+), 64 deletions(-) diff --git a/core/image_helpers.h b/core/image_helpers.h index 03e36322bb..6da6b9bb9b 100644 --- a/core/image_helpers.h +++ b/core/image_helpers.h @@ -17,6 +17,7 @@ #include "datatype.h" #include "apply.h" +#include "debug.h" namespace MR { @@ -32,19 +33,19 @@ namespace MR FORCE_INLINE auto __ndim (const AxesType& axes) -> decltype (axes.ndim(), size_t()) { return axes.ndim(); } template - FORCE_INLINE auto __get_index (const AxesType& axes, size_t axis) -> decltype (axes.size(), ssize_t()) + FORCE_INLINE auto __get_index (const AxesType& axes, size_t axis) -> decltype (axes.size(), ssize_t()) { return axes[axis]; } template - FORCE_INLINE auto __get_index (const AxesType& axes, size_t axis) -> decltype (axes.ndim(), ssize_t()) + FORCE_INLINE auto __get_index (const AxesType& axes, size_t axis) -> decltype (axes.ndim(), ssize_t()) { return axes.index(axis); } template - FORCE_INLINE auto __set_index (AxesType& axes, size_t axis, ssize_t index) -> decltype (axes.size(), void()) + FORCE_INLINE auto __set_index (AxesType& axes, size_t axis, ssize_t index) -> decltype (axes.size(), void()) { axes[axis] = index; } template - FORCE_INLINE auto __set_index (AxesType& axes, size_t axis, ssize_t index) -> decltype (axes.ndim(), void()) + FORCE_INLINE auto __set_index (AxesType& axes, size_t axis, ssize_t index) -> decltype (axes.ndim(), void()) { axes.index(axis) = index; } @@ -53,7 +54,7 @@ namespace MR __assign (size_t axis, ssize_t index) : axis (axis), index (index) { } const size_t axis; const ssize_t index; - template + template FORCE_INLINE void operator() (ImageType& x) { __set_index (x, axis, index); } }; @@ -62,7 +63,7 @@ namespace MR __assign (size_t axis, ssize_t index) : axis (axis), index (index) { } const size_t axis; const ssize_t index; - template + template FORCE_INLINE void operator() (ImageType& x) { apply (__assign (axis, index), x); } }; @@ -70,7 +71,7 @@ namespace MR struct __max_axis { NOMEMALIGN __max_axis (size_t& axis) : axis (axis) { } size_t& axis; - template + template FORCE_INLINE void operator() (ImageType& x) { if (axis > __ndim(x)) axis = __ndim(x); } }; @@ -78,7 +79,7 @@ namespace MR struct __max_axis> { NOMEMALIGN __max_axis (size_t& axis) : axis (axis) { } size_t& axis; - template + template FORCE_INLINE void operator() (ImageType& x) { apply (__max_axis (axis), x); } }; @@ -100,7 +101,7 @@ namespace MR struct __assign_pos_axes { NOMEMALIGN template FORCE_INLINE void to (DestImageType&... dest) const { - for (auto a : axes) + for (auto a : axes) apply (__assign (a, __get_index (ref, a)), std::tie (dest...)); } const ImageType& ref; @@ -116,9 +117,9 @@ namespace MR template struct enable_if_header_type { NOMEMALIGN typedef decltype ((void) ( - std::declval().ndim() + - std::declval().size(0) + - std::declval().name().size() + std::declval().ndim() + + std::declval().size(0) + + std::declval().name().size() ), std::declval()) type; }; @@ -126,8 +127,8 @@ namespace MR template class is_header_type { NOMEMALIGN typedef char yes[1], no[2]; - template static yes& test(typename enable_if_header_type::type); - template static no& test(...); + template static yes& test(typename enable_if_header_type::type); + template static no& test(...); public: static bool const value = sizeof(test(0)) == sizeof(yes); }; @@ -139,8 +140,8 @@ namespace MR template struct enable_if_image_type { NOMEMALIGN typedef decltype ((void) ( - std::declval().ndim() + - std::declval().size(0) + + std::declval().ndim() + + std::declval().size(0) + std::declval().name().size() + std::declval().value() + std::declval().index(0) @@ -152,8 +153,8 @@ namespace MR template class is_image_type { NOMEMALIGN typedef char yes[1], no[2]; - template static yes& test(typename enable_if_image_type::type); - template static no& test(...); + template static yes& test(typename enable_if_image_type::type); + template static no& test(...); public: static bool const value = sizeof(test(0)) == sizeof(yes); }; @@ -182,14 +183,14 @@ namespace MR /*! this can be used as follows: * \code * assign_pos_of (src_image, 0, 3).to (dest_image1, dest_image2); - * \endcode - * + * \endcode + * * This function will accept both ImageType objects (i.e. with ndim() & * index(size_t) methods) or VectorType objects (i.e. with size() & * operator[](size_t) methods). */ template - FORCE_INLINE __assign_pos_axis_range - assign_pos_of (const ImageType& reference, size_t from_axis = 0, size_t to_axis = std::numeric_limits::max()) + FORCE_INLINE __assign_pos_axis_range + assign_pos_of (const ImageType& reference, size_t from_axis = 0, size_t to_axis = std::numeric_limits::max()) { return { reference, from_axis, to_axis }; } @@ -199,21 +200,21 @@ namespace MR * \code * vector axes = { 0, 3, 4 }; * assign_pos (src_image, axes) (dest_image1, dest_image2); - * \endcode - * + * \endcode + * * This function will accept both ImageType objects (i.e. with ndim() & * index(size_t) methods) or VectorType objects (i.e. with size() & * operator[](size_t) methods). */ template - FORCE_INLINE __assign_pos_axes - assign_pos_of (const ImageType& reference, const vector& axes) + FORCE_INLINE __assign_pos_axes + assign_pos_of (const ImageType& reference, const vector& axes) { return { reference, axes }; } template - FORCE_INLINE __assign_pos_axes - assign_pos_of (const ImageType& reference, const vector&& axes) + FORCE_INLINE __assign_pos_axes + assign_pos_of (const ImageType& reference, const vector&& axes) { return assign_pos_of (reference, axes); } @@ -221,7 +222,7 @@ namespace MR template - FORCE_INLINE bool is_out_of_bounds (const ImageType& image, + FORCE_INLINE bool is_out_of_bounds (const ImageType& image, size_t from_axis = 0, size_t to_axis = std::numeric_limits::max()) { for (size_t n = from_axis; n < std::min (to_axis, image.ndim()); ++n) @@ -252,7 +253,7 @@ namespace MR } //! returns the number of voxel in the data set, or a relevant subvolume - template + template inline size_t voxel_count (const HeaderType& in, size_t from_axis = 0, size_t to_axis = std::numeric_limits::max()) { if (to_axis > in.ndim()) to_axis = in.ndim(); @@ -264,7 +265,7 @@ namespace MR } //! returns the number of voxel in the relevant subvolume of the data set - template + template inline size_t voxel_count (const HeaderType& in, const char* specifier) { size_t fp = 1; @@ -274,7 +275,7 @@ namespace MR } //! returns the number of voxel in the relevant subvolume of the data set - template + template inline size_t voxel_count (const HeaderType& in, const std::initializer_list axes) { size_t fp = 1; @@ -284,7 +285,7 @@ namespace MR } //! returns the number of voxel in the relevant subvolume of the data set - template + template inline int64_t voxel_count (const HeaderType& in, const vector& axes) { int64_t fp = 1; @@ -295,12 +296,12 @@ namespace MR return fp; } - template + template inline int64_t footprint (int64_t count) { return count * sizeof(ValueType); } - template <> + template <> inline int64_t footprint (int64_t count) { return (count+7)/8; } @@ -310,13 +311,13 @@ namespace MR } //! returns the memory footprint of an Image - template + template inline typename std::enable_if::value, int64_t>::type footprint (const HeaderType& in, size_t from_dim = 0, size_t up_to_dim = std::numeric_limits::max()) { return footprint (voxel_count (in, from_dim, up_to_dim), in.datatype()); } //! returns the memory footprint of an Image - template + template inline typename std::enable_if::value, int64_t>::type footprint (const HeaderType& in, const char* specifier) { return footprint (voxel_count (in, specifier), in.datatype()); } @@ -406,29 +407,33 @@ namespace MR template inline void check_transform (const HeaderType1& in1, const HeaderType2& in2, const double tol = 0.0) { - for (size_t i = 0; i < 3; ++i) { - for (size_t j = 0; j < 4; ++j) { - if (std::abs (in1.transform().matrix()(i,j) - in2.transform().matrix()(i,j)) > tol) - throw Exception ("images \"" + in1.name() + "\" and \"" + in2.name() + "\" do not have matching header transforms " + if (!transforms_match (in1, in2, tol)) + throw Exception ("images \"" + in1.name() + "\" and \"" + in2.name() + "\" do not have matching header transforms " + "\n" + str(in1.transform().matrix()) + "vs \n " + str(in2.transform().matrix()) + ")"); - } - } } template inline bool transforms_match (const HeaderType1 in1, const HeaderType2 in2, const double tol = 0.0) { - for (size_t i = 0; i < 3; ++i) { - for (size_t j = 0; j < 4; ++j) { - if (std::abs (in1.transform().matrix()(i,j) - in2.transform().matrix()(i,j)) > tol) - return false; - } - } - return true; + double bounds[] = { + 0.5 * ( in1.spacing(0)*in1.size(0) + in2.spacing(0)*in2.size(0) ), + 0.5 * ( in1.spacing(1)*in1.size(1) + in2.spacing(1)*in2.size(1) ), + 0.5 * ( in1.spacing(2)*in1.size(2) + in2.spacing(2)*in2.size(2) ) + }; + Eigen::Vector4 diffs ( + (in1.transform()*Eigen::Vector3 (0.0, 0.0, 0.0) - in2.transform()*Eigen::Vector3 (0.0, 0.0, 0.0)).norm(), + (in1.transform()*Eigen::Vector3 (bounds[0], bounds[1], 0.0) - in2.transform()*Eigen::Vector3 (bounds[0], bounds[1], 0.0)).norm(), + (in1.transform()*Eigen::Vector3 (bounds[0], 0.0, bounds[2]) - in2.transform()*Eigen::Vector3 (bounds[0], 0.0, bounds[2])).norm(), + (in1.transform()*Eigen::Vector3 (0.0, bounds[1], bounds[2]) - in2.transform()*Eigen::Vector3 (0.0, bounds[1], bounds[2])).norm() + ); + + double range = std::pow (bounds[0]*bounds[1]*bounds[2], 1.0/3.0); + + return diffs.maxCoeff() < range * tol; } template - inline void squeeze_dim (HeaderType& in, size_t from_axis = 3) + inline void squeeze_dim (HeaderType& in, size_t from_axis = 3) { size_t n = in.ndim(); while (in.size(n-1) <= 1 && n > from_axis) --n; @@ -466,7 +471,7 @@ namespace MR }; - template + template class Value { NOMEMALIGN public: using value_type = typename ImageType::value_type; @@ -508,7 +513,7 @@ namespace MR template class Row : - public ConstRow + public ConstRow { NOMEMALIGN public: @@ -518,11 +523,11 @@ namespace MR template Row (ConstRow&& other) { - assert (image.size(axis) == other.image.size(other.axis)); - for (image.index(axis) = 0, other.image.index(other.axis); + assert (image.size(axis) == other.image.size(other.axis)); + for (image.index(axis) = 0, other.image.index(other.axis); image.index(axis) < image.size(axis); - ++image.index(axis), ++other.image.index(other.axis)) - image.value() = typename OtherImageType::value_type (other.image.value()); + ++image.index(axis), ++other.image.index(other.axis)) + image.value() = typename OtherImageType::value_type (other.image.value()); } using ConstRow::image; @@ -553,12 +558,12 @@ namespace MR MRTRIX_OP(/=); #undef MRTRIX_OP - FORCE_INLINE void operator= (Row&& other) { - assert (image.size(axis) == other.image.size(other.axis)); - for (image.index(axis) = 0, other.image.index(other.axis) = 0; - image.index(axis) < image.size(axis); - ++image.index(axis), ++other.image.index(other.axis)) - image.value() = other.image.value(); + FORCE_INLINE void operator= (Row&& other) { + assert (image.size(axis) == other.image.size(other.axis)); + for (image.index(axis) = 0, other.image.index(other.axis) = 0; + image.index(axis) < image.size(axis); + ++image.index(axis), ++other.image.index(other.axis)) + image.value() = other.image.value(); } #define MRTRIX_OP(ARG) \ @@ -583,7 +588,7 @@ namespace MR template - class ImageBase + class ImageBase { MEMALIGN (ImageBase) public: using value_type = ValueType; From 7f793ed226c028280536a85ae902ceeb0b41eda1 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Mon, 27 Nov 2017 17:02:03 +0000 Subject: [PATCH 238/538] transforms_match: simplify test slightly --- core/image_helpers.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/image_helpers.h b/core/image_helpers.h index 6da6b9bb9b..894e62ae61 100644 --- a/core/image_helpers.h +++ b/core/image_helpers.h @@ -415,11 +415,11 @@ namespace MR template inline bool transforms_match (const HeaderType1 in1, const HeaderType2 in2, const double tol = 0.0) { - double bounds[] = { + Eigen::Vector3 bounds ( 0.5 * ( in1.spacing(0)*in1.size(0) + in2.spacing(0)*in2.size(0) ), 0.5 * ( in1.spacing(1)*in1.size(1) + in2.spacing(1)*in2.size(1) ), 0.5 * ( in1.spacing(2)*in1.size(2) + in2.spacing(2)*in2.size(2) ) - }; + ); Eigen::Vector4 diffs ( (in1.transform()*Eigen::Vector3 (0.0, 0.0, 0.0) - in2.transform()*Eigen::Vector3 (0.0, 0.0, 0.0)).norm(), (in1.transform()*Eigen::Vector3 (bounds[0], bounds[1], 0.0) - in2.transform()*Eigen::Vector3 (bounds[0], bounds[1], 0.0)).norm(), @@ -427,9 +427,7 @@ namespace MR (in1.transform()*Eigen::Vector3 (0.0, bounds[1], bounds[2]) - in2.transform()*Eigen::Vector3 (0.0, bounds[1], bounds[2])).norm() ); - double range = std::pow (bounds[0]*bounds[1]*bounds[2], 1.0/3.0); - - return diffs.maxCoeff() < range * tol; + return diffs.maxCoeff() < bounds.maxCoeff() * tol; } template From fed08a9a79a52bca9dd1bb097aedfea6f42a9617 Mon Sep 17 00:00:00 2001 From: Max Pietsch Date: Tue, 28 Nov 2017 15:17:22 +0000 Subject: [PATCH 239/538] transform_match() FOV check in voxels units, added voxel size test (for the latter, mrconvert fails with mif --> nii with tol 1e-6) #1199 --- core/image_helpers.h | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/core/image_helpers.h b/core/image_helpers.h index 894e62ae61..7637d532f0 100644 --- a/core/image_helpers.h +++ b/core/image_helpers.h @@ -406,28 +406,38 @@ namespace MR } template - inline void check_transform (const HeaderType1& in1, const HeaderType2& in2, const double tol = 0.0) { - if (!transforms_match (in1, in2, tol)) + inline void check_transform (const HeaderType1& in1, const HeaderType2& in2, + const double tol_fov = 1.0e-6, + const double tol_vox = 1.0e-4) { + if (!transforms_match (in1, in2, tol_fov, tol_vox)) throw Exception ("images \"" + in1.name() + "\" and \"" + in2.name() + "\" do not have matching header transforms " + "\n" + str(in1.transform().matrix()) + "vs \n " + str(in2.transform().matrix()) + ")"); } - + //! returns true if the image to scanner transformation and voxel sizes of in1 and in2 are within tolerance + //! tol_vox: relative difference in voxel sizes + //! tol_fov: tolerance of FOV corner displacement in voxel units template - inline bool transforms_match (const HeaderType1 in1, const HeaderType2 in2, const double tol = 0.0) { - Eigen::Vector3 bounds ( - 0.5 * ( in1.spacing(0)*in1.size(0) + in2.spacing(0)*in2.size(0) ), - 0.5 * ( in1.spacing(1)*in1.size(1) + in2.spacing(1)*in2.size(1) ), - 0.5 * ( in1.spacing(2)*in1.size(2) + in2.spacing(2)*in2.size(2) ) - ); - Eigen::Vector4 diffs ( - (in1.transform()*Eigen::Vector3 (0.0, 0.0, 0.0) - in2.transform()*Eigen::Vector3 (0.0, 0.0, 0.0)).norm(), - (in1.transform()*Eigen::Vector3 (bounds[0], bounds[1], 0.0) - in2.transform()*Eigen::Vector3 (bounds[0], bounds[1], 0.0)).norm(), - (in1.transform()*Eigen::Vector3 (bounds[0], 0.0, bounds[2]) - in2.transform()*Eigen::Vector3 (bounds[0], 0.0, bounds[2])).norm(), - (in1.transform()*Eigen::Vector3 (0.0, bounds[1], bounds[2]) - in2.transform()*Eigen::Vector3 (0.0, bounds[1], bounds[2])).norm() - ); - - return diffs.maxCoeff() < bounds.maxCoeff() * tol; + inline bool transforms_match (const HeaderType1 in1, const HeaderType2 in2, + const double tol_fov = 1.0e-4, const double tol_vox = 1.0e-4) { + + const Eigen::Vector3 vs1 (in1.spacing(0), in1.spacing(1), in1.spacing(2)); + const Eigen::Vector3 vs2 (in2.spacing(0), in2.spacing(1), in2.spacing(2)); + const Eigen::Vector3 vs_average (0.5*(vs1+vs2)); + if ((vs1-vs2).cwiseAbs().cwiseQuotient(vs_average).maxCoeff() > tol_vox) { + DEBUG ("transforms_match: absolute difference in voxel sizes: "+str((vs1-vs2).cwiseAbs())); + return false; + } + + Eigen::MatrixXd voxel_coord = Eigen::MatrixXd::Zero(4,4); + voxel_coord.row(3).fill(1.0); + voxel_coord(0,1) = voxel_coord(0,2) = 0.5 * (in1.size(0) + in2.size(0)); + voxel_coord(1,1) = voxel_coord(1,3) = 0.5 * (in1.size(1) + in2.size(1)); + voxel_coord(2,2) = voxel_coord(2,3) = 0.5 * (in1.size(2) + in2.size(2)); + + double diff_in_scannercoord = std::sqrt((in1.transform().matrix() * voxel_coord - in2.transform().matrix() * voxel_coord).colwise().squaredNorm().maxCoeff()); + DEBUG ("transforms_match: FOV difference in scanner coordinates: "+str(diff_in_scannercoord)); + return diff_in_scannercoord < vs_average.minCoeff() * tol_fov; } template From 96daf2cd9bd137cdf86fbad32adfdbd2742def00 Mon Sep 17 00:00:00 2001 From: Max Pietsch Date: Wed, 29 Nov 2017 23:01:26 +0000 Subject: [PATCH 240/538] transform_match renamed to voxel_grids_match_in_scanner_space, fixed FOV check and added dimension check; spacings_match: added tolerance #1199 --- cmd/mrcalc.cpp | 2 +- core/image_diff.h | 4 ++-- core/image_helpers.h | 41 +++++++++++++++++++---------------------- 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/cmd/mrcalc.cpp b/cmd/mrcalc.cpp index df70b57756..b7b5136583 100644 --- a/cmd/mrcalc.cpp +++ b/cmd/mrcalc.cpp @@ -585,7 +585,7 @@ void get_header (const StackEntry& entry, Header& header) for (size_t n = 0; n < std::min (header.ndim(), entry.image->ndim()); ++n) { if (header.size(n) > 1 && entry.image->size(n) > 1 && header.size(n) != entry.image->size(n)) throw Exception ("dimensions of input images do not match - aborting"); - if (!transforms_match (header, *(entry.image), 1.0e-4) && !transform_mis_match_reported) { + if (!voxel_grids_match_in_scanner_space (header, *(entry.image), 1.0e-4) && !transform_mis_match_reported) { WARN ("header transformations of input images do not match"); transform_mis_match_reported = true; } diff --git a/core/image_diff.h b/core/image_diff.h index 72da1fa7a6..b3e75a6ae6 100644 --- a/core/image_diff.h +++ b/core/image_diff.h @@ -110,9 +110,9 @@ namespace MR { if (!dimensions_match (in1, in2)) return false; - if (!spacings_match (in1, in2)) + if (!spacings_match (in1, in2, 1e-6)) // implicitly checked in voxel_grids_match_in_scanner_space but with different tolerance return false; - if (!transforms_match (in1, in2)) + if (!voxel_grids_match_in_scanner_space (in1, in2)) return false; return true; } diff --git a/core/image_helpers.h b/core/image_helpers.h index 7637d532f0..2a3d7e6a2a 100644 --- a/core/image_helpers.h +++ b/core/image_helpers.h @@ -325,30 +325,30 @@ namespace MR template - inline bool spacings_match (const HeaderType1& in1, const HeaderType2& in2) + inline bool spacings_match (const HeaderType1& in1, const HeaderType2& in2, const double tol=0.0) { if (in1.ndim() != in2.ndim()) return false; for (size_t n = 0; n < in1.ndim(); ++n) - if (in1.spacing (n) != in2.spacing(n)) return false; + if (std::abs(in1.spacing (n) - in2.spacing (n)) > tol * 0.5 * (in1.spacing (n) + in2.spacing (n))) return false; return true; } template - inline bool spacings_match (const HeaderType1& in1, const HeaderType2& in2, size_t from_axis, size_t to_axis) + inline bool spacings_match (const HeaderType1& in1, const HeaderType2& in2, size_t from_axis, size_t to_axis, const double tol=0.0) { assert (from_axis < to_axis); if (to_axis > in1.ndim() || to_axis > in2.ndim()) return false; for (size_t n = from_axis; n < to_axis; ++n) - if (in1.spacing (n) != in2.spacing (n)) return false; + if (std::abs(in1.spacing (n) - in2.spacing (n)) > tol * 0.5 * (in1.spacing (n) + in2.spacing (n))) return false; return true; } template - inline bool spacings_match (const HeaderType1& in1, const HeaderType2& in2, const vector& axes) + inline bool spacings_match (const HeaderType1& in1, const HeaderType2& in2, const vector& axes, const double tol=0.0) { for (size_t n = 0; n < axes.size(); ++n) { if (in1.ndim() <= axes[n] || in2.ndim() <= axes[n]) return false; - if (in1.spacing (axes[n]) != in2.spacing (axes[n])) return false; + if (std::abs(in1.spacing (axes[n]) - in2.spacing(axes[n])) > tol * 0.5 * (in1.spacing (axes[n]) + in2.spacing(axes[n]))) return false; } return true; } @@ -406,28 +406,24 @@ namespace MR } template - inline void check_transform (const HeaderType1& in1, const HeaderType2& in2, - const double tol_fov = 1.0e-6, - const double tol_vox = 1.0e-4) { - if (!transforms_match (in1, in2, tol_fov, tol_vox)) + inline void check_voxel_grids_match_in_scanner_space (const HeaderType1& in1, const HeaderType2& in2, const double tol = 1.0e-4) { + Eigen::IOFormat FullPrecFmt(Eigen::FullPrecision, 0, ", ", "\n", "[", "]"); + if (!voxel_grids_match_in_scanner_space (in1, in2, tol)) throw Exception ("images \"" + in1.name() + "\" and \"" + in2.name() + "\" do not have matching header transforms " - + "\n" + str(in1.transform().matrix()) + "vs \n " + str(in2.transform().matrix()) + ")"); + + "\n" + str(in1.transform().matrix().format(FullPrecFmt)) + + "\nvs\n" + str(in2.transform().matrix().format(FullPrecFmt)) + ")"); } //! returns true if the image to scanner transformation and voxel sizes of in1 and in2 are within tolerance - //! tol_vox: relative difference in voxel sizes - //! tol_fov: tolerance of FOV corner displacement in voxel units + //! tol: tolerance of FOV corner displacement in voxel units template - inline bool transforms_match (const HeaderType1 in1, const HeaderType2 in2, - const double tol_fov = 1.0e-4, const double tol_vox = 1.0e-4) { + inline bool voxel_grids_match_in_scanner_space (const HeaderType1 in1, const HeaderType2 in2, + const double tol = 1.0e-4) { + if (!dimensions_match(in1, in2)) + return false; const Eigen::Vector3 vs1 (in1.spacing(0), in1.spacing(1), in1.spacing(2)); const Eigen::Vector3 vs2 (in2.spacing(0), in2.spacing(1), in2.spacing(2)); - const Eigen::Vector3 vs_average (0.5*(vs1+vs2)); - if ((vs1-vs2).cwiseAbs().cwiseQuotient(vs_average).maxCoeff() > tol_vox) { - DEBUG ("transforms_match: absolute difference in voxel sizes: "+str((vs1-vs2).cwiseAbs())); - return false; - } Eigen::MatrixXd voxel_coord = Eigen::MatrixXd::Zero(4,4); voxel_coord.row(3).fill(1.0); @@ -435,9 +431,10 @@ namespace MR voxel_coord(1,1) = voxel_coord(1,3) = 0.5 * (in1.size(1) + in2.size(1)); voxel_coord(2,2) = voxel_coord(2,3) = 0.5 * (in1.size(2) + in2.size(2)); - double diff_in_scannercoord = std::sqrt((in1.transform().matrix() * voxel_coord - in2.transform().matrix() * voxel_coord).colwise().squaredNorm().maxCoeff()); + double diff_in_scannercoord = std::sqrt((vs1.asDiagonal() * in1.transform().matrix() * voxel_coord - + vs2.asDiagonal() * in2.transform().matrix() * voxel_coord).colwise().squaredNorm().maxCoeff()); DEBUG ("transforms_match: FOV difference in scanner coordinates: "+str(diff_in_scannercoord)); - return diff_in_scannercoord < vs_average.minCoeff() * tol_fov; + return diff_in_scannercoord < (0.5*(vs1+vs2)).minCoeff() * tol; } template From dd64cfb2674ec767e46ff7a1c46b84ec68a7757a Mon Sep 17 00:00:00 2001 From: Max Pietsch Date: Thu, 30 Nov 2017 11:16:19 +0000 Subject: [PATCH 241/538] voxel_grids_match_in_scanner_space checks only that spatial dimensions match --- core/image_helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/image_helpers.h b/core/image_helpers.h index 2a3d7e6a2a..dad79c5ab3 100644 --- a/core/image_helpers.h +++ b/core/image_helpers.h @@ -419,7 +419,7 @@ namespace MR template inline bool voxel_grids_match_in_scanner_space (const HeaderType1 in1, const HeaderType2 in2, const double tol = 1.0e-4) { - if (!dimensions_match(in1, in2)) + if (!dimensions_match(in1, in2, 0, 3)) return false; const Eigen::Vector3 vs1 (in1.spacing(0), in1.spacing(1), in1.spacing(2)); From b0679b11083a0324f0f91bf27b9209a8af290b27 Mon Sep 17 00:00:00 2001 From: Max Pietsch Date: Thu, 30 Nov 2017 11:22:46 +0000 Subject: [PATCH 242/538] nifti: warn if nifti s-form and pixdim voxel sizes do not match. Header spacing now uses the latter, not the s-form derived spacing --- core/file/nifti1_utils.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/file/nifti1_utils.cpp b/core/file/nifti1_utils.cpp index f0be5fe361..5d0ad349dc 100644 --- a/core/file/nifti1_utils.cpp +++ b/core/file/nifti1_utils.cpp @@ -179,10 +179,13 @@ namespace MR M(2,2) = Raw::fetch_ (&NH.srow_z[2], is_BE); M(2,3) = Raw::fetch_ (&NH.srow_z[3], is_BE); - // get voxel sizes: + // check voxel sizes: for (size_t axis = 0; axis != 3; ++axis) { if (size_t(ndim) > axis) - H.spacing(axis) = std::sqrt (Math::pow2 (M(0,axis)) + Math::pow2 (M(1,axis)) + Math::pow2 (M(2,axis))); + if (std::abs(H.spacing(axis) - std::sqrt (Math::pow2 (M(0,axis)) + Math::pow2 (M(1,axis)) + Math::pow2 (M(2,axis)))) > 1e-4) { + WARN ("voxel spacings inconsistent between NIFTI s-form and header field pixdim"); + break; + } } // normalize each transform axis: From 39d5a6138b3d56868f7bbaf7379b40d1ed8327e7 Mon Sep 17 00:00:00 2001 From: Max Pietsch Date: Thu, 30 Nov 2017 11:44:44 +0000 Subject: [PATCH 243/538] nifti2: warn if nifti s-form and pixdim voxel sizes do not match as b0679b1 nifti1 --- core/file/nifti2_utils.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/file/nifti2_utils.cpp b/core/file/nifti2_utils.cpp index d0fafa7ee2..90f2f88bb7 100644 --- a/core/file/nifti2_utils.cpp +++ b/core/file/nifti2_utils.cpp @@ -173,10 +173,13 @@ namespace MR M(2,2) = Raw::fetch_ (&NH.srow_z[2], is_BE); M(2,3) = Raw::fetch_ (&NH.srow_z[3], is_BE); - // get voxel sizes: + // check voxel sizes: for (size_t axis = 0; axis != 3; ++axis) { if (size_t(ndim) > axis) - H.spacing(axis) = std::sqrt (Math::pow2 (M(0,axis)) + Math::pow2 (M(1,axis)) + Math::pow2 (M(2,axis))); + if (std::abs(H.spacing(axis) - std::sqrt (Math::pow2 (M(0,axis)) + Math::pow2 (M(1,axis)) + Math::pow2 (M(2,axis)))) > 1e-4) { + WARN ("voxel spacings inconsistent between NIFTI s-form and header field pixdim"); + break; + } } // normalize each transform axis: From 074384530c8532f2188b72d2365b340a15f02004 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Thu, 30 Nov 2017 13:33:33 +0000 Subject: [PATCH 244/538] TravisCI: try to force an update of CA certificates to allow mercurial to connect to the Eigen repo... --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index ce8052a718..0b5e5781d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ addons: - python3 - python-pip - python3-pip + - ca-certificates compiler: - clang env: From e31d0a0cad2cf1e94338b1fb83fed13a990e2bbc Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Thu, 30 Nov 2017 13:38:13 +0000 Subject: [PATCH 245/538] TravisCI: try using --insecure option to hg to allow mercurial to access the Eigen repo. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0b5e5781d2..e4de6291f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ install: - export PATH=`pwd`/bin:${PATH} - export PYTHONPATH=`pwd`/lib:${PYTHONPATH} - export EIGEN_CFLAGS=-I`pwd`/../eigen - - (cd ..; hg clone https://bitbucket.org/eigen/eigen/; cd eigen; hg update 3.3) + - (cd ..; hg clone --insecure https://bitbucket.org/eigen/eigen/; cd eigen; hg update 3.3) - pip install urllib3[secure] - pip install --user pylint recommonmark sphinx sphinx-rtd-theme - pip3 install --user pylint recommonmark sphinx sphinx-rtd-theme From 19ac493dd3ffe3df98472a5f81ddd2d78c26051f Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Fri, 1 Dec 2017 13:13:06 +0000 Subject: [PATCH 246/538] fix SH precomputer Fixes issue #1204 --- core/math/SH.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/math/SH.h b/core/math/SH.h index 50b15da5b0..fa0b90558f 100644 --- a/core/math/SH.h +++ b/core/math/SH.h @@ -397,7 +397,7 @@ namespace MR for (int m = 0; m <= lmax; m++) { Legendre::Plm_sph (buf, lmax, m, cos_el); for (int l = ( (m&1) ?m+1:m); l <= lmax; l+=2) - p[index_mpos (l,m)] = SH_NON_M0_SCALE_FACTOR buf[l]; + p[index_mpos (l,m)] = buf[l]; } } } From 258d2bd79f07c0ef70087778aeca9e0f8c6c183f Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Mon, 4 Dec 2017 17:21:45 +0000 Subject: [PATCH 247/538] update testing data SHA1 --- testing/data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/data b/testing/data index 5e0f3ccb63..50e7baf52c 160000 --- a/testing/data +++ b/testing/data @@ -1 +1 @@ -Subproject commit 5e0f3ccb63ef2bdea941092ccd017b4af94dcc5d +Subproject commit 50e7baf52cc41d04a7a1c7d4f7aa5000c9ba8c95 From 613b76154601a2cc4bc4ff289abf39d0ae8a1870 Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Mon, 4 Dec 2017 17:35:28 +0000 Subject: [PATCH 248/538] remove support for the non-orthonormal SH basis --- cmd/sh2power.cpp | 22 +++++++--------------- cmd/shbasis.cpp | 13 +++---------- core/math/SH.h | 33 ++------------------------------- src/dwi/sdeconv/csd.h | 16 ++-------------- src/gui/dwi/renderer.cpp | 6 +++--- 5 files changed, 17 insertions(+), 73 deletions(-) diff --git a/cmd/sh2power.cpp b/cmd/sh2power.cpp index fcf08cd01c..5b0c189808 100644 --- a/cmd/sh2power.cpp +++ b/cmd/sh2power.cpp @@ -26,7 +26,7 @@ void usage () AUTHOR = "J-Donald Tournier (jdtournier@gmail.com)"; SYNOPSIS = "Compute the total power of a spherical harmonics image"; - + DESCRIPTION + "This command computes the sum of squared SH coefficients, " "which equals the mean-squared amplitude " @@ -35,10 +35,10 @@ void usage () ARGUMENTS + Argument ("SH", "the input spherical harmonics coefficients image.").type_image_in () + Argument ("power", "the output power image.").type_image_out (); - + OPTIONS + Option ("spectrum", "output the power spectrum, i.e., the power contained within each harmonic degree (l=0, 2, 4, ...) as a 4-D image."); - + } @@ -47,7 +47,7 @@ void run () { Math::SH::check (SH_data); Header power_header (SH_data); - + bool spectrum = get_options("spectrum").size(); int lmax = Math::SH::LforN (SH_data.size (3)); @@ -68,37 +68,29 @@ void run () { for (int m = -l; m <= l; ++m) { SH.index(3) = Math::SH::index (l, m); float val = SH.value(); -#ifdef USE_NON_ORTHONORMAL_SH_BASIS - if (m != 0) - val *= Math::sqrt1_2; -#endif power += Math::pow2 (val); } P.value() = power / (Math::pi * 4); ++P.index(3); } }; - + auto f2 = [&] (decltype(power_data)& P, decltype(SH_data)& SH) { float power = 0.0; for (int l = 0; l <= lmax; l+=2) { for (int m = -l; m <= l; ++m) { SH.index(3) = Math::SH::index (l, m); float val = SH.value(); -#ifdef USE_NON_ORTHONORMAL_SH_BASIS - if (m != 0) - val *= Math::sqrt1_2; -#endif power += Math::pow2 (val); } } P.value() = power / (Math::pi * 4); }; - + auto loop = ThreadedLoop ("calculating SH power", SH_data, 0, 3); if (spectrum) loop.run(f1, power_data, SH_data); else loop.run(f2, power_data, SH_data); - + } diff --git a/cmd/shbasis.cpp b/cmd/shbasis.cpp index 8702fe660f..a622edf181 100644 --- a/cmd/shbasis.cpp +++ b/cmd/shbasis.cpp @@ -45,8 +45,7 @@ void usage () DESCRIPTION + "In previous versions of MRtrix, the convention used for storing spherical harmonic " "coefficients was a non-orthonormal basis (the m!=0 coefficients were a factor of " - "sqrt(2) too large). This error has been rectified in the new MRtrix (assuming that " - "compilation was performed without the USE_NON_ORTHONORMAL_SH_BASIS symbol defined), " + "sqrt(2) too large). This error has been rectified in newer versions of MRtrix, " "but will cause issues if processing SH data that was generated using an older version " "of MRtrix (or vice-versa)." @@ -128,7 +127,7 @@ void check_and_update (Header& H, const conv_t conversion) } // Get sums independently for each l - + // Each order has a different power, and a different number of m!=0 volumes. // Therefore, calculate the mean-square intensity for the m==0 and m!=0 // volumes independently, and report ratio for each harmonic order @@ -305,13 +304,7 @@ void run () switch (int(opt[0][0])) { case 0: conversion = OLD; break; case 1: conversion = NEW; break; - case 2: -#ifndef USE_NON_ORTHONORMAL_SH_BASIS - conversion = NEW; -#else - conversion = OLD; -#endif - break; + case 2: conversion = NEW; break; case 3: conversion = FORCE_OLDTONEW; break; case 4: conversion = FORCE_NEWTOOLD; break; default: assert (0); break; diff --git a/core/math/SH.h b/core/math/SH.h index 961320eeae..82ab7f2475 100644 --- a/core/math/SH.h +++ b/core/math/SH.h @@ -15,10 +15,6 @@ #ifndef __math_SH_h__ #define __math_SH_h__ -#ifdef USE_NON_ORTHONORMAL_SH_BASIS -# warning using non-orthonormal SH basis -#endif - #include "math/legendre.h" #include "math/least_squares.h" @@ -97,13 +93,8 @@ namespace MR for (int m = 1; m <= lmax; m++) { Legendre::Plm_sph (AL, lmax, m, x); for (int l = ( (m&1) ? m+1 : m); l <= lmax; l+=2) { -#ifndef USE_NON_ORTHONORMAL_SH_BASIS SHT(i, index(l, m)) = Math::sqrt2 * AL[l]*std::cos (m*dirs (i,0)); SHT(i, index(l,-m)) = Math::sqrt2 * AL[l]*std::sin (m*dirs (i,0)); -#else - SHT(i, index(l, m)) = AL[l]*std::cos (m*dirs (i,0)); - SHT(i, index(l,-m)) = AL[l]*std::sin (m*dirs (i,0)); -#endif } } } @@ -218,13 +209,8 @@ namespace MR Legendre::Plm_sph (AL, lmax, m, cos_elevation); value_type c = c0 * cos_azimuth - s0 * sin_azimuth; // std::cos(m*azimuth) value_type s = s0 * cos_azimuth + c0 * sin_azimuth; // std::sin(m*azimuth) - for (int l = ( (m&1) ? m+1 : m); l <= lmax; l+=2) { -#ifndef USE_NON_ORTHONORMAL_SH_BASIS + for (int l = ( (m&1) ? m+1 : m); l <= lmax; l+=2) amplitude += AL[l] * Math::sqrt2 * (c * coefs[index (l,m)] + s * coefs[index (l,-m)]); -#else - amplitude += AL[l] * (c * coefs[index (l,m)] + s * coefs[index (l,-m)]); -#endif - } c0 = c; s0 = s; } @@ -269,13 +255,8 @@ namespace MR value_type c = c0 * cp - s0 * sp; value_type s = s0 * cp + c0 * sp; for (int l = ( (m&1) ? m+1 : m); l <= lmax; l+=2) { -#ifndef USE_NON_ORTHONORMAL_SH_BASIS delta_vec[index (l,m)] = AL[l] * Math::sqrt2 * c; delta_vec[index (l,-m)] = AL[l] * Math::sqrt2 * s; -#else - delta_vec[index (l,m)] = AL[l] * 2.0 * c; - delta_vec[index (l,-m)] = AL[l] * 2.0 * s; -#endif } c0 = c; s0 = s; @@ -358,11 +339,6 @@ namespace MR typename vector::const_iterator p1, p2; }; -#ifndef USE_NON_ORTHONORMAL_SH_BASIS -#define SH_NON_M0_SCALE_FACTOR (m ? Math::sqrt2 : 1.0)* -#else -#define SH_NON_M0_SCALE_FACTOR -#endif //! Precomputed Associated Legrendre Polynomials - used to speed up SH calculation template class PrecomputedAL @@ -396,7 +372,7 @@ namespace MR for (int m = 0; m <= lmax; m++) { Legendre::Plm_sph (buf, lmax, m, cos_el); for (int l = ( (m&1) ?m+1:m); l <= lmax; l+=2) - p[index_mpos (l,m)] = SH_NON_M0_SCALE_FACTOR buf[l]; + p[index_mpos (l,m)] = (m ? Math::sqrt2 : 1.0) * buf[l]; } } } @@ -575,13 +551,8 @@ namespace MR } for (int m = 1; m <= lmax; m++) { -#ifndef USE_NON_ORTHONORMAL_SH_BASIS value_type caz = Math::sqrt2 * std::cos (m*azimuth); value_type saz = Math::sqrt2 * std::sin (m*azimuth); -#else - value_type caz = std::cos (m*azimuth); - value_type saz = std::sin (m*azimuth); -#endif for (int l = ( (m&1) ? m+1 : m); l <= lmax; l+=2) { const value_type& vp (sh[index (l,m)]); const value_type& vm (sh[index (l,-m)]); diff --git a/src/dwi/sdeconv/csd.h b/src/dwi/sdeconv/csd.h index 27cf3422c9..67ea8e01d8 100644 --- a/src/dwi/sdeconv/csd.h +++ b/src/dwi/sdeconv/csd.h @@ -61,7 +61,7 @@ namespace MR dwis = DWI::Shells (grad).select_shells (true, false, true).largest().get_volumes(); DW_dirs = DWI::gen_direction_matrix (grad, dwis); - lmax_data = Math::SH::LforN (dwis.size()); + lmax_data = Math::SH::LforN (dwis.size()); } @@ -188,19 +188,7 @@ namespace MR // min-norm constraint: if (norm_lambda) { norm_lambda *= NORM_LAMBDA_MULTIPLIER * Mt_M (0,0); -#ifndef USE_NON_ORTHONORMAL_SH_BASIS Mt_M.diagonal().array() += norm_lambda; -#else - int l = 0; - for (size_t i = 0; i < Mt_M.rows(); ++i) { - if (Math::SH::index (l,0) == i) { - Mt_M(i,i) += norm_lambda; - l+=2; - } - else - Mt_M(i,i) += 0.5 * norm_lambda; - } -#endif } INFO ("constrained spherical deconvolution initialised successfully"); @@ -267,7 +255,7 @@ namespace MR for (size_t i = 0; i < neg.size(); i++) HR_T.row (i) = shared.HR_trans.row (neg[i]); auto HR_T_view = HR_T.topRows (neg.size()); - work.triangularView() += HR_T_view.transpose() * HR_T_view; + work.triangularView() += HR_T_view.transpose() * HR_T_view; } F.noalias() = llt.compute (work.triangularView()).solve (Mt_b); diff --git a/src/gui/dwi/renderer.cpp b/src/gui/dwi/renderer.cpp index f3a35416ce..6ab35bbf98 100644 --- a/src/gui/dwi/renderer.cpp +++ b/src/gui/dwi/renderer.cpp @@ -50,7 +50,7 @@ namespace MR - void Renderer::start (const Projection& projection, const GL::Lighting& lighting, float scale, + void Renderer::start (const Projection& projection, const GL::Lighting& lighting, float scale, bool use_lighting, bool colour_by_direction, bool hide_neg_values, bool orthographic) { switch (mode) { @@ -437,7 +437,7 @@ namespace MR for (int l = 0; l <= lmax; l+=2) { for (int m = 0; m <= l; m++) { const int idx (Math::SH::index (l,m)); - transform (3*n, idx) = transform(3*n, idx-2*m) = SH_NON_M0_SCALE_FACTOR Math::Legendre::Plm_sph (l, m, vertices[n][2]); + transform (3*n, idx) = transform(3*n, idx-2*m) = (m ? Math::sqrt2 : 1.0) * Math::Legendre::Plm_sph (l, m, vertices[n][2]); } } @@ -455,7 +455,7 @@ namespace MR for (int l = 2* ( (m+1) /2); l <= lmax; l+=2) { const int idx (Math::SH::index (l,m)); transform (3*n+1, idx) = - transform (3*n, idx-1) * sqrt (float ( (l+m) * (l-m+1))); - if (l > m) + if (l > m) transform (3*n+1,idx) += transform (3*n, idx+1) * sqrt (float ( (l-m) * (l+m+1))); transform (3*n+1, idx) /= 2.0; From 2258b08a5a4f12ffd4f234432b0c060084e7f659 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Tue, 5 Dec 2017 15:38:45 +1100 Subject: [PATCH 249/538] -stride --> -strides --- bin/dwi2response | 4 ++-- bin/dwibiascorrect | 6 +++--- bin/dwigradcheck | 2 +- bin/dwipreproc | 8 ++++---- bin/labelsgmfix | 4 ++-- cmd/mrinfo.cpp | 10 +++++----- core/stride.cpp | 6 +++--- docs/getting_started/image_data.rst | 10 +++++----- .../ismrm_hcp_tutorial.rst | 2 +- docs/reference/commands/amp2sh.rst | 2 +- docs/reference/commands/dwi2fod.rst | 2 +- docs/reference/commands/dwiextract.rst | 2 +- docs/reference/commands/maskfilter.rst | 2 +- docs/reference/commands/mrconvert.rst | 2 +- docs/reference/commands/mrfilter.rst | 2 +- docs/reference/commands/mrinfo.rst | 2 +- docs/reference/commands/sh2amp.rst | 2 +- docs/reference/commands/shconv.rst | 2 +- lib/mrtrix3/_5ttgen/fsl.py | 8 ++++---- lib/mrtrix3/dwi2response/manual.py | 2 +- lib/mrtrix3/dwi2response/msmt_5tt.py | 2 +- lib/mrtrix3/image.py | 6 +++--- testing/tests/mrconvert | 10 +++++----- 23 files changed, 49 insertions(+), 49 deletions(-) diff --git a/bin/dwi2response b/bin/dwi2response index 166d3153f4..6ef8e3fd3d 100755 --- a/bin/dwi2response +++ b/bin/dwi2response @@ -81,9 +81,9 @@ app.makeTempDir() # Get standard input data into the temporary directory if alg.needsSingleShell() or shells_option: - run.command('mrconvert ' + path.fromUser(app.args.input, True) + ' - -stride 0,0,0,1' + grad_import_option + ' | dwiextract - ' + path.toTemp('dwi.mif', True) + shells_option + singleshell_option) + run.command('mrconvert ' + path.fromUser(app.args.input, True) + ' - -strides 0,0,0,1' + grad_import_option + ' | dwiextract - ' + path.toTemp('dwi.mif', True) + shells_option + singleshell_option) else: # Don't discard b=0 in multi-shell algorithms - run.command('mrconvert ' + path.fromUser(app.args.input, True) + ' ' + path.toTemp('dwi.mif', True) + ' -stride 0,0,0,1' + grad_import_option) + run.command('mrconvert ' + path.fromUser(app.args.input, True) + ' ' + path.toTemp('dwi.mif', True) + ' -strides 0,0,0,1' + grad_import_option) if app.args.mask: run.command('mrconvert ' + path.fromUser(app.args.mask, True) + ' ' + path.toTemp('mask.mif', True) + ' -datatype bit') else: diff --git a/bin/dwibiascorrect b/bin/dwibiascorrect index acd81b86dc..c20539a3aa 100755 --- a/bin/dwibiascorrect +++ b/bin/dwibiascorrect @@ -91,7 +91,7 @@ run.command('dwiextract in.mif - -bzero | mrmath - mean mean_bzero.mif -axis 3') if app.args.fsl: # FAST doesn't accept a mask input; therefore need to explicitly mask the input image - run.command('mrcalc mean_bzero.mif mask.mif -mult - | mrconvert - mean_bzero_masked.nii -stride -1,+2,+3') + run.command('mrcalc mean_bzero.mif mask.mif -mult - | mrconvert - mean_bzero_masked.nii -strides -1,+2,+3') run.command(fast_cmd + ' -t 2 -o fast -n 3 -b mean_bzero_masked.nii') bias_path = fsl.findImage('fast_bias') @@ -105,8 +105,8 @@ elif app.args.ants: # Use the brain mask as a weights image rather than a mask; means that voxels at the edge of the mask # will have a smoothly-varying bias field correction applied, rather than multiplying by 1.0 outside the mask - run.command('mrconvert mean_bzero.mif mean_bzero.nii -stride +1,+2,+3') - run.command('mrconvert mask.mif mask.nii -stride +1,+2,+3') + run.command('mrconvert mean_bzero.mif mean_bzero.nii -strides +1,+2,+3') + run.command('mrconvert mask.mif mask.nii -strides +1,+2,+3') bias_path = 'bias.nii' run.command('N4BiasFieldCorrection -d 3 -i mean_bzero.nii -w mask.nii -o [corrected.nii,' + bias_path + '] -s 4 -b [100,3] -c [1000,0.0]') diff --git a/bin/dwigradcheck b/bin/dwigradcheck index 4df359c114..0a571e6e91 100755 --- a/bin/dwigradcheck +++ b/bin/dwigradcheck @@ -43,7 +43,7 @@ num_volumes = image_dimensions[3] app.makeTempDir() # Make sure the image data can be memory-mapped -run.command('mrconvert ' + app.args.input + ' ' + path.toTemp('data.mif', True) + ' -stride 0,0,0,1 -datatype float32') +run.command('mrconvert ' + app.args.input + ' ' + path.toTemp('data.mif', True) + ' -strides 0,0,0,1 -datatype float32') if app.args.grad: shutil.copy(path.fromUser(app.args.grad, False), path.toTemp('grad.b', False)) diff --git a/bin/dwipreproc b/bin/dwipreproc index a3fddc3225..cca10f00e0 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -733,7 +733,7 @@ if do_topup: # Do the conversion in preparation for topup - run.command('mrconvert ' + se_epi_path + ' topup_in.nii' + import_se_epi_manual_pe_table_option + ' -stride -1,+2,+3,+4 -export_pe_table topup_datain.txt') + run.command('mrconvert ' + se_epi_path + ' topup_in.nii' + import_se_epi_manual_pe_table_option + ' -strides -1,+2,+3,+4 -export_pe_table topup_datain.txt') file.delTemporary(se_epi_path) # Run topup @@ -788,7 +788,7 @@ if do_topup: else: # Generate a processing mask for eddy based on the uncorrected input DWIs - run.command('dwi2mask ' + dwi_path + ' - | maskfilter - dilate - | mrconvert - eddy_mask.nii -datatype float32 -stride -1,+2,+3') + run.command('dwi2mask ' + dwi_path + ' - | maskfilter - dilate - | mrconvert - eddy_mask.nii -datatype float32 -strides -1,+2,+3') # Generate the text file containing slice timing / grouping information if necessary @@ -827,7 +827,7 @@ eddy_manual_options = (' ' + ' '.join(eddy_manual_options)) if eddy_manual_optio # Run eddy -run.command('mrconvert ' + dwi_path + import_dwi_pe_table_option + dwi_permute_volumes_pre_eddy_option + ' eddy_in.nii -stride -1,+2,+3,+4 -export_grad_fsl bvecs bvals -export_pe_eddy eddy_config.txt eddy_indices.txt') +run.command('mrconvert ' + dwi_path + import_dwi_pe_table_option + dwi_permute_volumes_pre_eddy_option + ' eddy_in.nii -strides -1,+2,+3,+4 -export_grad_fsl bvecs bvals -export_pe_eddy eddy_config.txt eddy_indices.txt') file.delTemporary(dwi_path) run.command(eddy_cmd + ' --imain=eddy_in.nii --mask=eddy_mask.nii --acqp=eddy_config.txt --index=eddy_indices.txt --bvecs=bvecs --bvals=bvals' + eddy_in_topup_option + eddy_manual_options + ' --out=dwi_post_eddy') file.delTemporary('eddy_in.nii') @@ -838,7 +838,7 @@ eddy_output_image_path = fsl.findImage('dwi_post_eddy') # Get the axis strides from the input series, so the output image can be modified to match -stride_option = ' -stride ' + ','.join([str(i) for i in dwi_header.stride()]) +stride_option = ' -strides ' + ','.join([str(i) for i in dwi_header.stride()]) # Check to see whether or not eddy has provided a rotated bvecs file; diff --git a/bin/labelsgmfix b/bin/labelsgmfix index ef2795aa08..424b34990b 100755 --- a/bin/labelsgmfix +++ b/bin/labelsgmfix @@ -75,9 +75,9 @@ app.makeTempDir() # Get the parcellation and T1 images into the temporary directory, with conversion of the T1 into the correct format for FSL run.command('mrconvert ' + path.fromUser(app.args.parc, True) + ' ' + path.toTemp('parc.mif', True)) if upsample_for_first: - run.command('mrresize ' + path.fromUser(app.args.t1, True) + ' - -voxel 1.0 -interp sinc | mrcalc - 0.0 -max - | mrconvert - ' + path.toTemp('T1.nii', True) + ' -stride -1,+2,+3') + run.command('mrresize ' + path.fromUser(app.args.t1, True) + ' - -voxel 1.0 -interp sinc | mrcalc - 0.0 -max - | mrconvert - ' + path.toTemp('T1.nii', True) + ' -strides -1,+2,+3') else: - run.command('mrconvert ' + path.fromUser(app.args.t1, True) + ' ' + path.toTemp('T1.nii', True) + ' -stride -1,+2,+3') + run.command('mrconvert ' + path.fromUser(app.args.t1, True) + ' ' + path.toTemp('T1.nii', True) + ' -strides -1,+2,+3') app.gotoTempDir() diff --git a/cmd/mrinfo.cpp b/cmd/mrinfo.cpp index 57fff9677b..bc195935d3 100644 --- a/cmd/mrinfo.cpp +++ b/cmd/mrinfo.cpp @@ -76,7 +76,7 @@ void usage () + Option ("size", "image size along each axis") + Option ("spacing", "voxel spacing along each image dimension") + Option ("datatype", "data type used for image data storage") - + Option ("stride", "data strides i.e. order and direction of axes data layout") + + Option ("strides", "data strides i.e. order and direction of axes data layout") + Option ("offset", "image intensity offset") + Option ("multiplier", "image intensity multiplier") + Option ("transform", "the voxel to image transformation") @@ -236,7 +236,7 @@ void header2json (const Header& header, nlohmann::json& json) json["spacing"] = spacing; vector strides (Stride::get (header)); Stride::symbolise (strides); - json["stride"] = strides; + json["strides"] = strides; json["format"] = header.format(); json["datatype"] = header.datatype().specifier(); json["intensity_offset"] = header.intensity_offset(); @@ -278,7 +278,7 @@ void run () const bool size = get_options("size") .size(); const bool spacing = get_options("spacing") .size(); const bool datatype = get_options("datatype") .size(); - const bool stride = get_options("stride") .size(); + const bool strides = get_options("strides") .size(); const bool offset = get_options("offset") .size(); const bool multiplier = get_options("multiplier") .size(); const auto properties = get_options("property"); @@ -289,7 +289,7 @@ void run () const bool raw_dwgrad = get_options("raw_dwgrad") .size(); const bool petable = get_options("petable") .size(); - const bool print_full_header = !(format || ndim || size || spacing || datatype || stride || + const bool print_full_header = !(format || ndim || size || spacing || datatype || strides || offset || multiplier || properties.size() || transform || dwgrad || export_grad || shellvalues || shellcounts || export_pe || petable || json_keyval || json_all); @@ -306,7 +306,7 @@ void run () if (size) print_dimensions (header); if (spacing) print_spacing (header); if (datatype) std::cout << (header.datatype().specifier() ? header.datatype().specifier() : "invalid") << "\n"; - if (stride) print_strides (header); + if (strides) print_strides (header); if (offset) std::cout << header.intensity_offset() << "\n"; if (multiplier) std::cout << header.intensity_scale() << "\n"; if (transform) print_transform (header); diff --git a/core/stride.cpp b/core/stride.cpp index 1c166b70d8..243a24d196 100644 --- a/core/stride.cpp +++ b/core/stride.cpp @@ -23,7 +23,7 @@ namespace MR using namespace App; const OptionGroup Options = OptionGroup ("Stride options") - + Option ("stride", + + Option ("strides", "specify the strides of the output data in memory, as a comma-separated list. " "The actual strides produced will depend on whether the output image " "format can support it.") @@ -84,7 +84,7 @@ namespace MR if (strides.size() > current.size()) - WARN ("too many axes supplied to -stride option - ignoring remaining strides"); + WARN ("too many axes supplied to -strides option - ignoring remaining strides"); strides.resize (current.size(), 0); for (const auto x : strides) @@ -95,7 +95,7 @@ namespace MR if (!strides[1]) continue; for (size_t j = i+1; j < strides.size(); ++j) if (std::abs (strides[i]) == std::abs (strides[j])) - throw Exception ("duplicate entries provided to \"-stride\" option: " + str(opt[0][0])); + throw Exception ("duplicate entries provided to \"-strides\" option: " + str(opt[0][0])); } List prev = get_symbolic (current); diff --git a/docs/getting_started/image_data.rst b/docs/getting_started/image_data.rst index a1dd5b3de8..9e9b33352f 100644 --- a/docs/getting_started/image_data.rst +++ b/docs/getting_started/image_data.rst @@ -284,17 +284,17 @@ for applications that need to process all values for a given voxel concurrently (as is often the case in diffusion MRI), by allowing the hardware to make better use of resources (tractography is one such example). -Many *MRtrix3* commands accept the ``-stride`` option, which is used to specify +Many *MRtrix3* commands accept the ``-strides`` option, which is used to specify the strides for the output image. For example, to generate a LAS (radiological) NIfTI image for use with FSL (along with the corresponding bvecs/bvals), you -can use :ref:`mrconvert` along with the ``-stride -1,2,3,4`` option:: +can use :ref:`mrconvert` along with the ``-strides -1,2,3,4`` option:: - $ mrconvert dwi.mif -stride -1,2,3,4 -export_grad_fsl bvecs bvals dwi.nii + $ mrconvert dwi.mif -strides -1,2,3,4 -export_grad_fsl bvecs bvals dwi.nii Likewise, if you need to ensure the orientation is neurological (RAS), you can specify strides ``1,2,3,4`` (or use the ``1:4`` shorthand). You can also specify -other combinations if required: for example ``-stride -2,-1,3,4`` would -correspond to a PLS coordinate system, ``-stride 2,3,4,1`` would correspond to +other combinations if required: for example ``-strides -2,-1,3,4`` would +correspond to a PLS coordinate system, ``-strides 2,3,4,1`` would correspond to volume-contiguous storage (with RAS for the spatial axes), etc. The different formats supported by *MRtrix3* differ in the range of strides diff --git a/docs/quantitative_structural_connectivity/ismrm_hcp_tutorial.rst b/docs/quantitative_structural_connectivity/ismrm_hcp_tutorial.rst index b668729e1e..29d0ce19d4 100644 --- a/docs/quantitative_structural_connectivity/ismrm_hcp_tutorial.rst +++ b/docs/quantitative_structural_connectivity/ismrm_hcp_tutorial.rst @@ -95,7 +95,7 @@ Diffusion image processing in memory for each voxel, and convert to floating-point representation (makes data access faster in subsequent commands): -``mrconvert data.nii.gz DWI.mif -fslgrad bvecs bvals -datatype float32 -stride 0,0,0,1`` +``mrconvert data.nii.gz DWI.mif -fslgrad bvecs bvals -datatype float32 -strides 0,0,0,1`` 2. Generate a mean *b*\ =0 image (useful for visualisation): diff --git a/docs/reference/commands/amp2sh.rst b/docs/reference/commands/amp2sh.rst index aaf82c8804..36f8bac0e4 100644 --- a/docs/reference/commands/amp2sh.rst +++ b/docs/reference/commands/amp2sh.rst @@ -55,7 +55,7 @@ DW shell selection options Stride options ^^^^^^^^^^^^^^ -- **-stride spec** specify the strides of the output data in memory, as a comma-separated list. The actual strides produced will depend on whether the output image format can support it. +- **-strides spec** specify the strides of the output data in memory, as a comma-separated list. The actual strides produced will depend on whether the output image format can support it. Standard options ^^^^^^^^^^^^^^^^ diff --git a/docs/reference/commands/dwi2fod.rst b/docs/reference/commands/dwi2fod.rst index e96219aa14..eac1bbd25c 100644 --- a/docs/reference/commands/dwi2fod.rst +++ b/docs/reference/commands/dwi2fod.rst @@ -66,7 +66,7 @@ Options for the Constrained Spherical Deconvolution algorithm Stride options ^^^^^^^^^^^^^^ -- **-stride spec** specify the strides of the output data in memory, as a comma-separated list. The actual strides produced will depend on whether the output image format can support it. +- **-strides spec** specify the strides of the output data in memory, as a comma-separated list. The actual strides produced will depend on whether the output image format can support it. Standard options ^^^^^^^^^^^^^^^^ diff --git a/docs/reference/commands/dwiextract.rst b/docs/reference/commands/dwiextract.rst index c7f668377e..420183051c 100644 --- a/docs/reference/commands/dwiextract.rst +++ b/docs/reference/commands/dwiextract.rst @@ -56,7 +56,7 @@ Options for selecting volumes based on phase-encoding Stride options ^^^^^^^^^^^^^^ -- **-stride spec** specify the strides of the output data in memory, as a comma-separated list. The actual strides produced will depend on whether the output image format can support it. +- **-strides spec** specify the strides of the output data in memory, as a comma-separated list. The actual strides produced will depend on whether the output image format can support it. Standard options ^^^^^^^^^^^^^^^^ diff --git a/docs/reference/commands/maskfilter.rst b/docs/reference/commands/maskfilter.rst index fc46ba9232..b500fb95b5 100644 --- a/docs/reference/commands/maskfilter.rst +++ b/docs/reference/commands/maskfilter.rst @@ -56,7 +56,7 @@ Options for median filter Stride options ^^^^^^^^^^^^^^ -- **-stride spec** specify the strides of the output data in memory, as a comma-separated list. The actual strides produced will depend on whether the output image format can support it. +- **-strides spec** specify the strides of the output data in memory, as a comma-separated list. The actual strides produced will depend on whether the output image format can support it. Standard options ^^^^^^^^^^^^^^^^ diff --git a/docs/reference/commands/mrconvert.rst b/docs/reference/commands/mrconvert.rst index 2c54b72806..11884189d0 100644 --- a/docs/reference/commands/mrconvert.rst +++ b/docs/reference/commands/mrconvert.rst @@ -70,7 +70,7 @@ Options to modify generic header entries Stride options ^^^^^^^^^^^^^^ -- **-stride spec** specify the strides of the output data in memory, as a comma-separated list. The actual strides produced will depend on whether the output image format can support it. +- **-strides spec** specify the strides of the output data in memory, as a comma-separated list. The actual strides produced will depend on whether the output image format can support it. Data type options ^^^^^^^^^^^^^^^^^ diff --git a/docs/reference/commands/mrfilter.rst b/docs/reference/commands/mrfilter.rst index 2d75c484fa..6daf6c8fa3 100644 --- a/docs/reference/commands/mrfilter.rst +++ b/docs/reference/commands/mrfilter.rst @@ -73,7 +73,7 @@ Options for smooth filter Stride options ^^^^^^^^^^^^^^ -- **-stride spec** specify the strides of the output data in memory, as a comma-separated list. The actual strides produced will depend on whether the output image format can support it. +- **-strides spec** specify the strides of the output data in memory, as a comma-separated list. The actual strides produced will depend on whether the output image format can support it. Standard options ^^^^^^^^^^^^^^^^ diff --git a/docs/reference/commands/mrinfo.rst b/docs/reference/commands/mrinfo.rst index f01974848b..1a634c82fd 100644 --- a/docs/reference/commands/mrinfo.rst +++ b/docs/reference/commands/mrinfo.rst @@ -41,7 +41,7 @@ Options - **-datatype** data type used for image data storage -- **-stride** data strides i.e. order and direction of axes data layout +- **-strides** data strides i.e. order and direction of axes data layout - **-offset** image intensity offset diff --git a/docs/reference/commands/sh2amp.rst b/docs/reference/commands/sh2amp.rst index b189510360..bd608d3b8b 100644 --- a/docs/reference/commands/sh2amp.rst +++ b/docs/reference/commands/sh2amp.rst @@ -29,7 +29,7 @@ Options Stride options ^^^^^^^^^^^^^^ -- **-stride spec** specify the strides of the output data in memory, as a comma-separated list. The actual strides produced will depend on whether the output image format can support it. +- **-strides spec** specify the strides of the output data in memory, as a comma-separated list. The actual strides produced will depend on whether the output image format can support it. Data type options ^^^^^^^^^^^^^^^^^ diff --git a/docs/reference/commands/shconv.rst b/docs/reference/commands/shconv.rst index b85660ec54..0a9acfeaa2 100644 --- a/docs/reference/commands/shconv.rst +++ b/docs/reference/commands/shconv.rst @@ -27,7 +27,7 @@ Options Stride options ^^^^^^^^^^^^^^ -- **-stride spec** specify the strides of the output data in memory, as a comma-separated list. The actual strides produced will depend on whether the output image format can support it. +- **-strides spec** specify the strides of the output data in memory, as a comma-separated list. The actual strides produced will depend on whether the output image format can support it. Standard options ^^^^^^^^^^^^^^^^ diff --git a/lib/mrtrix3/_5ttgen/fsl.py b/lib/mrtrix3/_5ttgen/fsl.py index 649d93fd01..8df7616d9e 100644 --- a/lib/mrtrix3/_5ttgen/fsl.py +++ b/lib/mrtrix3/_5ttgen/fsl.py @@ -24,11 +24,11 @@ def getInputs(): #pylint: disable=unused-variable image.check3DNonunity(path.fromUser(app.args.input, False)) run.command('mrconvert ' + path.fromUser(app.args.input, True) + ' ' + path.toTemp('input.mif', True)) if app.args.mask: - run.command('mrconvert ' + path.fromUser(app.args.mask, True) + ' ' + path.toTemp('mask.mif', True) + ' -datatype bit -stride -1,+2,+3') + run.command('mrconvert ' + path.fromUser(app.args.mask, True) + ' ' + path.toTemp('mask.mif', True) + ' -datatype bit -strides -1,+2,+3') if app.args.t2: if not image.match(app.args.input, app.args.t2): app.error('Provided T2 image does not match input T1 image') - run.command('mrconvert ' + path.fromUser(app.args.t2, True) + ' ' + path.toTemp('T2.nii', True) + ' -stride -1,+2,+3') + run.command('mrconvert ' + path.fromUser(app.args.t2, True) + ' ' + path.toTemp('T2.nii', True) + ' -strides -1,+2,+3') @@ -68,7 +68,7 @@ def execute(): #pylint: disable=unused-variable 'retaining the original higher resolution of the T1 image is preferable') upsample_for_first = True - run.command('mrconvert input.mif T1.nii -stride -1,+2,+3') + run.command('mrconvert input.mif T1.nii -strides -1,+2,+3') fast_t1_input = 'T1.nii' fast_t2_input = '' @@ -206,7 +206,7 @@ def execute(): #pylint: disable=unused-variable run.command('mrcalc ' + fast_gm_output + ' multiplier_noNAN.mif -mult remove_unconnected_wm_mask.mif -mult cgm.mif') run.command('mrcalc ' + fast_wm_output + ' multiplier_noNAN.mif -mult remove_unconnected_wm_mask.mif -mult wm.mif') run.command('mrcalc 0 wm.mif -min path.mif') - run.command('mrcat cgm.mif sgm.mif wm.mif csf.mif path.mif - -axis 3 | mrconvert - combined_precrop.mif -stride +2,+3,+4,+1') + run.command('mrcat cgm.mif sgm.mif wm.mif csf.mif path.mif - -axis 3 | mrconvert - combined_precrop.mif -strides +2,+3,+4,+1') # Use mrcrop to reduce file size (improves caching of image data during tracking) if app.args.nocrop: diff --git a/lib/mrtrix3/dwi2response/manual.py b/lib/mrtrix3/dwi2response/manual.py index 39738c01b9..7035d62179 100644 --- a/lib/mrtrix3/dwi2response/manual.py +++ b/lib/mrtrix3/dwi2response/manual.py @@ -23,7 +23,7 @@ def getInputs(): #pylint: disable=unused-variable os.remove(mask_path) run.command('mrconvert ' + path.fromUser(app.args.in_voxels, True) + ' ' + path.toTemp('in_voxels.mif', True)) if app.args.dirs: - run.command('mrconvert ' + path.fromUser(app.args.dirs, True) + ' ' + path.toTemp('dirs.mif', True) + ' -stride 0,0,0,1') + run.command('mrconvert ' + path.fromUser(app.args.dirs, True) + ' ' + path.toTemp('dirs.mif', True) + ' -strides 0,0,0,1') diff --git a/lib/mrtrix3/dwi2response/msmt_5tt.py b/lib/mrtrix3/dwi2response/msmt_5tt.py index d69aeb8d72..9dff24a786 100644 --- a/lib/mrtrix3/dwi2response/msmt_5tt.py +++ b/lib/mrtrix3/dwi2response/msmt_5tt.py @@ -26,7 +26,7 @@ def getInputs(): #pylint: disable=unused-variable from mrtrix3 import app, path, run run.command('mrconvert ' + path.fromUser(app.args.in_5tt, True) + ' ' + path.toTemp('5tt.mif', True)) if app.args.dirs: - run.command('mrconvert ' + path.fromUser(app.args.dirs, True) + ' ' + path.toTemp('dirs.mif', True) + ' -stride 0,0,0,1') + run.command('mrconvert ' + path.fromUser(app.args.dirs, True) + ' ' + path.toTemp('dirs.mif', True) + ' -strides 0,0,0,1') diff --git a/lib/mrtrix3/image.py b/lib/mrtrix3/image.py index 8c10321ea3..b68b1f881a 100644 --- a/lib/mrtrix3/image.py +++ b/lib/mrtrix3/image.py @@ -27,7 +27,7 @@ def __init__(self, image_path): self._name = data['name'] self._size = data['size'] self._spacing = data['spacing'] - self._stride = data['stride'] + self._strides = data['strides'] self._format = data['format'] self._datatype = data['datatype'] self._intensity_offset = data['intensity_offset'] @@ -47,8 +47,8 @@ def size(self): return self._size def spacing(self): return self._spacing - def stride(self): - return self._stride + def strides(self): + return self._strides def format(self): return self._format def datatype(self): diff --git a/testing/tests/mrconvert b/testing/tests/mrconvert index d493116480..1ade2d61ce 100644 --- a/testing/tests/mrconvert +++ b/testing/tests/mrconvert @@ -1,11 +1,11 @@ mrconvert mrconvert/in.mif - | testing_diff_image - mrconvert/in.mif -mrconvert mrconvert/in.mif -stride 2,-1,3 - | testing_diff_image - mrconvert/in.mif +mrconvert mrconvert/in.mif -strides 2,-1,3 - | testing_diff_image - mrconvert/in.mif mrconvert mrconvert/in.mif -datatype cfloat32 - | testing_diff_image - mrconvert/in.mif -mrconvert mrconvert/in.mif -stride 3,1,2 tmp.mif && testing_diff_image tmp.mif mrconvert/in.mif -mrconvert mrconvert/in.mif -stride 1,-3,2 -datatype float32be tmp.mih && testing_diff_image tmp.mih mrconvert/in.mif +mrconvert mrconvert/in.mif -strides 3,1,2 tmp.mif && testing_diff_image tmp.mif mrconvert/in.mif +mrconvert mrconvert/in.mif -strides 1,-3,2 -datatype float32be tmp.mih && testing_diff_image tmp.mih mrconvert/in.mif mrconvert mrconvert/in.mif -datatype float32 tmp.mif.gz && testing_diff_image tmp.mif.gz mrconvert/in.mif mrconvert mrconvert/in.mif tmp.nii && testing_diff_image tmp.nii mrconvert/in.mif mrconvert mrconvert/in.mif -datatype float32 tmp.nii.gz && testing_diff_image tmp.nii.gz mrconvert/in.mif -mrconvert mrconvert/in.mif -stride 3,2,1 tmp.mgh && testing_diff_image tmp.mgh mrconvert/in.mif -mrconvert mrconvert/in.mif -stride 1,3,2 -datatype int16 tmp.mgz && testing_diff_image tmp.mgz mrconvert/in.mif +mrconvert mrconvert/in.mif -strides 3,2,1 tmp.mgh && testing_diff_image tmp.mgh mrconvert/in.mif +mrconvert mrconvert/in.mif -strides 1,3,2 -datatype int16 tmp.mgz && testing_diff_image tmp.mgz mrconvert/in.mif mrconvert dwi.mif tmp-[].mif; testing_diff_image dwi.mif tmp-[].mif From a00bf16694c3b9deb3632b601374c783b1aadefa Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Tue, 5 Dec 2017 16:42:13 +1100 Subject: [PATCH 250/538] mesh2pve --> mesh2voxel --- bin/labelsgmfix | 2 +- cmd/{mesh2pve.cpp => mesh2voxel.cpp} | 0 docs/reference/commands/{mesh2pve.rst => mesh2voxel.rst} | 6 +++--- docs/reference/commands_list.rst | 4 ++-- lib/mrtrix3/_5ttgen/fsl.py | 4 ++-- testing/tests/mesh2pve | 1 - testing/tests/mesh2voxel | 1 + 7 files changed, 9 insertions(+), 9 deletions(-) rename cmd/{mesh2pve.cpp => mesh2voxel.cpp} (100%) rename docs/reference/commands/{mesh2pve.rst => mesh2voxel.rst} (95%) delete mode 100644 testing/tests/mesh2pve create mode 100644 testing/tests/mesh2voxel diff --git a/bin/labelsgmfix b/bin/labelsgmfix index 424b34990b..0a9d367b93 100755 --- a/bin/labelsgmfix +++ b/bin/labelsgmfix @@ -121,7 +121,7 @@ for key, value in structure_map.items(): mask_list.append(image_path) vtk_in_path = 'first-' + key + '_first.vtk' run.command('meshconvert ' + vtk_in_path + ' first-' + key + '_transformed.vtk -transform first2real T1.nii') - run.command('mesh2pve first-' + key + '_transformed.vtk parc.mif - | mrthreshold - ' + image_path + ' -abs 0.5') + run.command('mesh2voxel first-' + key + '_transformed.vtk parc.mif - | mrthreshold - ' + image_path + ' -abs 0.5') # Add to the SGM image; don't worry about overlap for now node_index = sgm_lut[value] run.command('mrcalc ' + image_path + ' ' + node_index + ' sgm.mif -if sgm_new.mif') diff --git a/cmd/mesh2pve.cpp b/cmd/mesh2voxel.cpp similarity index 100% rename from cmd/mesh2pve.cpp rename to cmd/mesh2voxel.cpp diff --git a/docs/reference/commands/mesh2pve.rst b/docs/reference/commands/mesh2voxel.rst similarity index 95% rename from docs/reference/commands/mesh2pve.rst rename to docs/reference/commands/mesh2voxel.rst index d62cd2eb5c..b374d6e764 100644 --- a/docs/reference/commands/mesh2pve.rst +++ b/docs/reference/commands/mesh2voxel.rst @@ -1,6 +1,6 @@ -.. _mesh2pve: +.. _mesh2voxel: -mesh2pve +mesh2voxel =================== Synopsis @@ -13,7 +13,7 @@ Usage :: - mesh2pve [ options ] source template output + mesh2voxel [ options ] source template output - *source*: the mesh file; note vertices must be defined in realspace coordinates - *template*: the template image diff --git a/docs/reference/commands_list.rst b/docs/reference/commands_list.rst index 2525cd621c..68be33bb89 100644 --- a/docs/reference/commands_list.rst +++ b/docs/reference/commands_list.rst @@ -51,7 +51,7 @@ List of MRtrix3 commands commands/labelconvert commands/maskdump commands/maskfilter - commands/mesh2pve + commands/mesh2voxel commands/meshconvert commands/meshfilter commands/mraverageheader @@ -164,7 +164,7 @@ List of MRtrix3 commands :ref:`labelconvert`, "Convert a connectome node image from one lookup table to another" :ref:`maskdump`, "Print out the locations of all non-zero voxels in a mask image" :ref:`maskfilter`, "Perform filtering operations on 3D / 4D mask images" - :ref:`mesh2pve`, "Convert a mesh surface to a partial volume estimation image" + :ref:`mesh2voxel`, "Convert a mesh surface to a partial volume estimation image" :ref:`meshconvert`, "Convert meshes between different formats, and apply transformations" :ref:`meshfilter`, "Apply filter operations to meshes" :ref:`mraverageheader`, "Calculate the average (unbiased) coordinate space of all input images" diff --git a/lib/mrtrix3/_5ttgen/fsl.py b/lib/mrtrix3/_5ttgen/fsl.py index 8df7616d9e..12a41890c1 100644 --- a/lib/mrtrix3/_5ttgen/fsl.py +++ b/lib/mrtrix3/_5ttgen/fsl.py @@ -178,11 +178,11 @@ def execute(): #pylint: disable=unused-variable pve_image_list = [ ] progress = app.progressBar('Generating partial volume images for SGM structures', len(sgm_structures)) for struct in sgm_structures: - pve_image_path = 'mesh2pve_' + struct + '.mif' + pve_image_path = 'mesh2voxel_' + struct + '.mif' vtk_in_path = 'first-' + struct + '_first.vtk' vtk_temp_path = struct + '.vtk' run.command('meshconvert ' + vtk_in_path + ' ' + vtk_temp_path + ' -transform first2real ' + first_input) - run.command('mesh2pve ' + vtk_temp_path + ' ' + fast_t1_input + ' ' + pve_image_path) + run.command('mesh2voxel ' + vtk_temp_path + ' ' + fast_t1_input + ' ' + pve_image_path) pve_image_list.append(pve_image_path) progress.increment() progress.done() diff --git a/testing/tests/mesh2pve b/testing/tests/mesh2pve deleted file mode 100644 index e77626209b..0000000000 --- a/testing/tests/mesh2pve +++ /dev/null @@ -1 +0,0 @@ -mesh2pve meshconvert/in.vtk meshconvert/image.mif.gz - | testing_diff_image - mesh2pve/out.mif.gz -abs 1.5e-3 diff --git a/testing/tests/mesh2voxel b/testing/tests/mesh2voxel new file mode 100644 index 0000000000..fe419fbb18 --- /dev/null +++ b/testing/tests/mesh2voxel @@ -0,0 +1 @@ +mesh2voxel meshconvert/in.vtk meshconvert/image.mif.gz - | testing_diff_image - mesh2voxel/out.mif.gz -abs 1.5e-3 From 47de4ba09c9361c9c3aafab75fd837ea96c765bd Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Wed, 6 Dec 2017 12:34:07 +1100 Subject: [PATCH 251/538] userdocs update --- docs/reference/commands/shbasis.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/commands/shbasis.rst b/docs/reference/commands/shbasis.rst index 6833434e42..2b9c36d2c0 100644 --- a/docs/reference/commands/shbasis.rst +++ b/docs/reference/commands/shbasis.rst @@ -20,7 +20,7 @@ Usage Description ----------- -In previous versions of MRtrix, the convention used for storing spherical harmonic coefficients was a non-orthonormal basis (the m!=0 coefficients were a factor of sqrt(2) too large). This error has been rectified in the new MRtrix (assuming that compilation was performed without the USE_NON_ORTHONORMAL_SH_BASIS symbol defined), but will cause issues if processing SH data that was generated using an older version of MRtrix (or vice-versa). +In previous versions of MRtrix, the convention used for storing spherical harmonic coefficients was a non-orthonormal basis (the m!=0 coefficients were a factor of sqrt(2) too large). This error has been rectified in newer versions of MRtrix, but will cause issues if processing SH data that was generated using an older version of MRtrix (or vice-versa). This command provides a mechanism for testing the basis used in storage of image data representing a spherical harmonic series per voxel, and allows the user to forcibly modify the raw image data to conform to the desired basis. From 764bba64a977f228ea1137bdf2ed07c8bdb9a204 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Wed, 6 Dec 2017 15:42:31 +1100 Subject: [PATCH 252/538] update test data folder name --- testing/data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/data b/testing/data index a12d572926..5341f9e7df 160000 --- a/testing/data +++ b/testing/data @@ -1 +1 @@ -Subproject commit a12d5729264bc03db223aad9dcc27859a29af95f +Subproject commit 5341f9e7dfa9cf68199e838f85be75e7b83419b1 From 82c66caf74d6f32f419d54cd724154c3b5788d8e Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Wed, 6 Dec 2017 16:51:20 +1100 Subject: [PATCH 253/538] a few remaining stride --> strides in dwipreproc --- bin/dwipreproc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/dwipreproc b/bin/dwipreproc index cca10f00e0..2754727bc6 100755 --- a/bin/dwipreproc +++ b/bin/dwipreproc @@ -776,9 +776,9 @@ if do_topup: # Use the initial corrected volumes to derive a brain mask for eddy if len(applytopup_image_list) == 1: - run.command('dwi2mask ' + applytopup_image_list[0] + ' - | maskfilter - dilate - | mrconvert - eddy_mask.nii -datatype float32 -stride -1,+2,+3') + run.command('dwi2mask ' + applytopup_image_list[0] + ' - | maskfilter - dilate - | mrconvert - eddy_mask.nii -datatype float32 -strides -1,+2,+3') else: - run.command('mrcat ' + ' '.join(applytopup_image_list) + ' - -axis 3 | dwi2mask - - | maskfilter - dilate - | mrconvert - eddy_mask.nii -datatype float32 -stride -1,+2,+3') + run.command('mrcat ' + ' '.join(applytopup_image_list) + ' - -axis 3 | dwi2mask - - | maskfilter - dilate - | mrconvert - eddy_mask.nii -datatype float32 -strides -1,+2,+3') for entry in applytopup_image_list: file.delTemporary(entry) @@ -838,7 +838,7 @@ eddy_output_image_path = fsl.findImage('dwi_post_eddy') # Get the axis strides from the input series, so the output image can be modified to match -stride_option = ' -strides ' + ','.join([str(i) for i in dwi_header.stride()]) +stride_option = ' -strides ' + ','.join([str(i) for i in dwi_header.strides()]) # Check to see whether or not eddy has provided a rotated bvecs file; From 713b435a43ecb2a2a0901cebcbe09cd2e23fb95a Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Wed, 6 Dec 2017 16:56:56 +1100 Subject: [PATCH 254/538] removing deprecated mtbin command --- cmd/mtbin.cpp | 373 ------------------------------ docs/reference/commands/mtbin.rst | 77 ------ docs/reference/commands_list.rst | 2 - 3 files changed, 452 deletions(-) delete mode 100644 cmd/mtbin.cpp delete mode 100644 docs/reference/commands/mtbin.rst diff --git a/cmd/mtbin.cpp b/cmd/mtbin.cpp deleted file mode 100644 index 40d5bf6f3b..0000000000 --- a/cmd/mtbin.cpp +++ /dev/null @@ -1,373 +0,0 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. - * - * MRtrix is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * For more details, see http://www.mrtrix.org/. - */ - - -#include "command.h" -#include "image.h" -#include "algo/loop.h" -#include "adapter/extract.h" -#include "filter/optimal_threshold.h" -#include "filter/mask_clean.h" -#include "filter/connected_components.h" -#include "transform.h" -#include "math/least_squares.h" -#include "algo/threaded_copy.h" - -using namespace MR; -using namespace App; - -#define DEFAULT_NORM_VALUE 0.282094 -#define DEFAULT_MAXITER_VALUE 100 - -void usage () -{ - AUTHOR = "David Raffelt (david.raffelt@florey.edu.au), Rami Tabbara (rami.tabbara@florey.edu.au) and Thijs Dhollander (thijs.dhollander@gmail.com)"; - - SYNOPSIS = "Multi-Tissue Bias field correction and Intensity Normalisation (WARNING: deprecated)."; - - DESCRIPTION - + "WARNING: this command is deprecated and may produce highly inappropriate results in several cases. Not recommended and at your own discretion. Please use the new mtnormalise command instead for reliable results."; - - ARGUMENTS - + Argument ("input output", "list of all input and output tissue compartment files. See example usage in the description. " - "Note that any number of tissues can be normalised").type_image_in().allow_multiple(); - - OPTIONS - + Option ("mask", "define the mask to compute the normalisation within. This option is mandatory.").required () - + Argument ("image").type_image_in () - - + Option ("value", "specify the value to which the summed tissue compartments will be normalised to " - "(Default: sqrt(1/(4*pi)) = " + str(DEFAULT_NORM_VALUE, 6) + ")") - + Argument ("number").type_float () - - + Option ("bias", "output the estimated bias field") - + Argument ("image").type_image_out () - - + Option ("independent", "intensity normalise each tissue type independently") - - + Option ("maxiter", "set the maximum number of iterations. Default(" + str(DEFAULT_MAXITER_VALUE) + "). " - "It will stop before the max iterations if convergence is detected") - + Argument ("number").type_integer() - - + Option ("check", "check the final mask used to compute the bias field. This mask excludes outlier regions ignored by the bias field fitting procedure. However, these regions are still corrected for bias fields based on the other image data.") - + Argument ("image").type_image_out () - - + Option ("override", "consciously use this deprecated command. Not recommended and at your own discretion."); -} - -const int n_basis_vecs (20); - - -FORCE_INLINE Eigen::MatrixXd basis_function (const Eigen::Vector3 pos) { - double x = pos[0]; - double y = pos[1]; - double z = pos[2]; - Eigen::MatrixXd basis(n_basis_vecs, 1); - basis(0) = 1.0; - basis(1) = x; - basis(2) = y; - basis(3) = z; - basis(4) = x * y; - basis(5) = x * z; - basis(6) = y * z; - basis(7) = x * x; - basis(8) = y * y; - basis(9)= z * x; - basis(10)= x * x * y; - basis(11) = x * x * z; - basis(12) = y * y * x; - basis(13) = y * y * z; - basis(14) = z * z * x; - basis(15) = z * z * y; - basis(16) = x * x * x; - basis(17) = y * y * y; - basis(18) = z * z * z; - basis(19) = x * y * z; - return basis; -} - -// Currently not used, but keep if we want to make mask argument optional in the future -FORCE_INLINE void compute_mask (Image& summed, Image& mask) { - LogLevelLatch level (0); - Filter::OptimalThreshold threshold_filter (summed); - if (!mask.valid()) - mask = Image::scratch (threshold_filter); - threshold_filter (summed, mask); - Filter::ConnectedComponents connected_filter (mask); - connected_filter.set_largest_only (true); - connected_filter (mask, mask); - Filter::MaskClean clean_filter (mask); - clean_filter (mask, mask); -} - - -FORCE_INLINE void refine_mask (Image& summed, - Image& initial_mask, - Image& refined_mask) { - - for (auto i = Loop (summed, 0, 3) (summed, initial_mask, refined_mask); i; ++i) { - if (std::isfinite((float) summed.value ()) && summed.value () > 0.f && initial_mask.value ()) - refined_mask.value () = true; - else - refined_mask.value () = false; - } -} - - -void run () -{ - - WARN ("This command is deprecated and may produce inappropriate results in several cases. Please use the new mtnormalise."); - - if (!get_options("override").size()) - throw Exception ("This command is deprecated and not recommended for proper use of its original advertised functions. Check the option list for an option to consciously use this command anyway."); - - if (argument.size() % 2) - throw Exception ("The number of input arguments must be even. There must be an output file provided for every input tissue image"); - - if (argument.size() < 4) - throw Exception ("At least two tissue types must be provided"); - - ProgressBar progress ("performing intensity normalisation and bias field correction..."); - vector > input_images; - vector
output_headers; - vector output_filenames; - - - // Open input images and check for output - for (size_t i = 0; i < argument.size(); i += 2) { - progress++; - input_images.emplace_back (Image::open (argument[i])); - - // check if all inputs have the same dimensions - if (i) - check_dimensions (input_images[0], input_images[i / 2], 0, 3); - - if (Path::exists (argument[i + 1]) && !App::overwrite_files) - throw Exception ("output file \"" + argument[i] + "\" already exists (use -force option to force overwrite)"); - - // we can't create the image yet if we want to put the scale factor into the output header - output_headers.emplace_back (Header::open (argument[i])); - output_filenames.push_back (argument[i + 1]); - } - - // Load the mask - Header header_3D (input_images[0]); - header_3D.ndim() = 3; - auto opt = get_options ("mask"); - - auto orig_mask = Image::open (opt[0][0]); - auto initial_mask = Image::scratch (orig_mask); - auto mask = Image::scratch (orig_mask); - - auto summed = Image::scratch (header_3D); - for (size_t j = 0; j < input_images.size(); ++j) { - for (auto i = Loop (summed, 0, 3) (summed, input_images[j]); i; ++i) - summed.value() += input_images[j].value(); - progress++; - } - - // Refine the initial mask to exclude negative summed tissue components - refine_mask (summed, orig_mask, initial_mask); - - threaded_copy (initial_mask, mask); - - size_t num_voxels = 0; - for (auto i = Loop (mask) (mask); i; ++i) { - if (mask.value()) - num_voxels++; - } - progress++; - - if (!num_voxels) - throw Exception ("error in automatic mask generation. Mask contains no voxels"); - - const float normalisation_value = get_option_value ("value", DEFAULT_NORM_VALUE); - const size_t max_iter = get_option_value ("maxiter", DEFAULT_MAXITER_VALUE); - - // Initialise bias field - Eigen::MatrixXd bias_field_weights (n_basis_vecs, 1); - auto bias_field = Image::scratch (header_3D); - for (auto i = Loop(bias_field)(bias_field); i; ++i) - bias_field.value() = 1.0; - - Eigen::MatrixXd scale_factors (input_images.size(), 1); - Eigen::MatrixXd previous_scale_factors (input_images.size(), 1); - size_t iter = 1; - bool converged = false; - - // Iterate until convergence or max iterations performed - while (!converged && iter < max_iter) { - - INFO ("iteration: " + str(iter)); - // Solve for tissue normalisation scale factors - Eigen::MatrixXd X (num_voxels, input_images.size()); - Eigen::MatrixXd y (num_voxels, 1); - y.fill (normalisation_value); - uint32_t index = 0; - for (auto i = Loop (mask) (mask, bias_field); i; ++i) { - if (mask.value()) { - for (size_t j = 0; j < input_images.size(); ++j) { - assign_pos_of (mask, 0, 3).to (input_images[j]); - X (index, j) = input_images[j].value() / bias_field.value(); - } - ++index; - } - } - progress++; - scale_factors = X.colPivHouseholderQr().solve(y); - progress++; - - INFO ("scale factors: " + str(scale_factors.transpose())); - - - // Solve for bias field weights - Transform transform (mask); - Eigen::MatrixXd bias_field_basis (num_voxels, n_basis_vecs); - index = 0; - for (auto i = Loop (mask) (mask); i; ++i) { - if (mask.value()) { - Eigen::Vector3 vox (mask.index(0), mask.index(1), mask.index(2)); - Eigen::Vector3 pos = transform.voxel2scanner * vox; - bias_field_basis.row (index) = basis_function (pos).col(0); - - double sum = 0.0; - for (size_t j = 0; j < input_images.size(); ++j) { - assign_pos_of (mask, 0, 3).to (input_images[j]); - sum += scale_factors(j,0) * input_images[j].value() ; - } - y (index++, 0) = sum / normalisation_value; - } - } - progress++; - bias_field_weights = bias_field_basis.colPivHouseholderQr().solve(y); - progress++; - - - // Normalise the bias field within the mask - double mean = 0.0; - for (auto i = Loop (bias_field) (bias_field, mask); i; ++i) { - Eigen::Vector3 vox (bias_field.index(0), bias_field.index(1), bias_field.index(2)); - Eigen::Vector3 pos = transform.voxel2scanner * vox; - bias_field.value() = basis_function (pos).col(0).dot (bias_field_weights.col(0)); - if (mask.value()) - mean += bias_field.value(); - } - progress++; - mean /= num_voxels; - for (auto i = Loop (bias_field) (bias_field, mask); i; ++i) - bias_field.value() /= mean; - - progress++; - - // Check for convergence - Eigen::MatrixXd diff; - if (iter > 1) { - diff = previous_scale_factors.array() - scale_factors.array(); - diff = diff.array().abs() / previous_scale_factors.array(); - INFO ("percentage change in estimated scale factors: " + str(diff.mean() * 100)); - if (diff.mean() < 0.001) - converged = true; - } - - // Re-evaluate mask - if (!converged) { - auto summed = Image::scratch (header_3D); - for (size_t j = 0; j < input_images.size(); ++j) { - for (auto i = Loop (summed, 0, 3) (summed, input_images[j], bias_field); i; ++i) { - summed.value() += scale_factors(j, 0) * input_images[j].value() / bias_field.value(); - } - } - - refine_mask (summed, initial_mask, mask); - - vector summed_values; - for (auto i = Loop (mask) (mask, summed); i; ++i) { - if (mask.value()) - summed_values.push_back (summed.value()); - } - num_voxels = summed_values.size(); - - // Reject outliers after a few iterations once the summed image is largely corrected for the bias field - if (iter > 2) { - INFO ("rejecting outliers"); - std::sort (summed_values.begin(), summed_values.end()); - float lower_quartile = summed_values[std::round ((float)num_voxels * 0.25)]; - float upper_quartile = summed_values[std::round ((float)num_voxels * 0.75)]; - float upper_outlier_threshold = upper_quartile + 1.6 * (upper_quartile - lower_quartile); - float lower_outlier_threshold = lower_quartile - 1.6 * (upper_quartile - lower_quartile); - - for (auto i = Loop (mask) (mask, summed); i; ++i) { - if (mask.value()) { - if (summed.value() < lower_outlier_threshold || summed.value() > upper_outlier_threshold) { - mask.value() = 0; - num_voxels--; - } - } - } - } - if (log_level >= 3) - display (mask); - } - - previous_scale_factors = scale_factors; - - progress++; - iter++; - } - - opt = get_options ("bias"); - if (opt.size()) { - auto bias_field_output = Image::create (opt[0][0], header_3D); - threaded_copy (bias_field, bias_field_output); - } - progress++; - - opt = get_options ("check"); - if (opt.size()) { - auto mask_output = Image::create (opt[0][0], mask); - threaded_copy (mask, mask_output); - } - progress++; - - // compute mean of all scale factors in the log domain - opt = get_options ("independent"); - if (!opt.size()) { - float mean = 0.0; - for (int i = 0; i < scale_factors.size(); ++i) - mean += std::log(scale_factors(i, 0)); - mean /= scale_factors.size(); - mean = std::exp (mean); - scale_factors.fill (mean); - } - - // output bias corrected and normalised tissue maps - uint32_t total_count = 0; - for (size_t i = 0; i < output_headers.size(); ++i) { - uint32_t count = 1; - for (size_t j = 0; j < output_headers[i].ndim(); ++j) - count *= output_headers[i].size(j); - total_count += count; - } - for (size_t j = 0; j < output_filenames.size(); ++j) { - output_headers[j].keyval()["normalisation_scale_factor"] = str(scale_factors(j, 0)); - auto output_image = Image::create (output_filenames[j], output_headers[j]); - for (auto i = Loop (output_image) (output_image, input_images[j]); i; ++i) { - assign_pos_of (output_image, 0, 3).to (bias_field); - output_image.value() = scale_factors(j, 0) * input_images[j].value() / bias_field.value(); - } - } - - WARN ("Using the output images as part of a pipeline to analyse one's data is discouraged."); - -} diff --git a/docs/reference/commands/mtbin.rst b/docs/reference/commands/mtbin.rst deleted file mode 100644 index 6602cffd01..0000000000 --- a/docs/reference/commands/mtbin.rst +++ /dev/null @@ -1,77 +0,0 @@ -.. _mtbin: - -mtbin -=================== - -Synopsis --------- - -Multi-Tissue Bias field correction and Intensity Normalisation (WARNING: deprecated). - -Usage --------- - -:: - - mtbin [ options ] input output [ input output ... ] - -- *input output*: list of all input and output tissue compartment files. See example usage in the description. Note that any number of tissues can be normalised - -Description ------------ - -WARNING: this command is deprecated and may produce highly inappropriate results in several cases. Not recommended and at your own discretion. Please use the new mtnormalise command instead for reliable results. - -Options -------- - -- **-mask image** define the mask to compute the normalisation within. This option is mandatory. - -- **-value number** specify the value to which the summed tissue compartments will be normalised to (Default: sqrt(1/(4*pi)) = 0.282094) - -- **-bias image** output the estimated bias field - -- **-independent** intensity normalise each tissue type independently - -- **-maxiter number** set the maximum number of iterations. Default(100). It will stop before the max iterations if convergence is detected - -- **-check image** check the final mask used to compute the bias field. This mask excludes outlier regions ignored by the bias field fitting procedure. However, these regions are still corrected for bias fields based on the other image data. - -- **-override** consciously use this deprecated command. Not recommended and at your own discretion. - -Standard options -^^^^^^^^^^^^^^^^ - -- **-info** display information messages. - -- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - -- **-debug** display debugging messages. - -- **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. - -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - -- **-help** display this information page and exit. - -- **-version** display version information and exit. - --------------- - - - -**Author:** David Raffelt (david.raffelt@florey.edu.au), Rami Tabbara (rami.tabbara@florey.edu.au) and Thijs Dhollander (thijs.dhollander@gmail.com) - -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. - -This Source Code Form is subject to the terms of the Mozilla Public -License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. - -MRtrix is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty -of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -For more details, see http://www.mrtrix.org/. - - diff --git a/docs/reference/commands_list.rst b/docs/reference/commands_list.rst index 68be33bb89..1010e9191d 100644 --- a/docs/reference/commands_list.rst +++ b/docs/reference/commands_list.rst @@ -78,7 +78,6 @@ List of MRtrix3 commands commands/mrthreshold commands/mrtransform commands/mrview - commands/mtbin commands/mtnormalise commands/peaks2amp commands/sh2amp @@ -191,7 +190,6 @@ List of MRtrix3 commands :ref:`mrthreshold`, "Create bitwise image by thresholding image intensity" :ref:`mrtransform`, "Apply spatial transformations to an image" :ref:`mrview`, "The MRtrix image viewer." - :ref:`mtbin`, "Multi-Tissue Bias field correction and Intensity Normalisation (WARNING: deprecated)." :ref:`mtnormalise`, "Multi-tissue informed log-domain intensity normalisation" :ref:`peaks2amp`, "Convert peak directions image to amplitudes" :ref:`sh2amp`, "Evaluate the amplitude of an image of spherical harmonic functions along specified directions" From 579d1296a61af8b998f51ee0fb7341e6c8de9548 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Wed, 6 Dec 2017 16:57:50 +1100 Subject: [PATCH 255/538] removing deprecated dwi2noise command --- cmd/dwi2noise.cpp | 93 --------------------------- docs/reference/commands/dwi2noise.rst | 80 ----------------------- docs/reference/commands_list.rst | 2 - 3 files changed, 175 deletions(-) delete mode 100644 cmd/dwi2noise.cpp delete mode 100644 docs/reference/commands/dwi2noise.rst diff --git a/cmd/dwi2noise.cpp b/cmd/dwi2noise.cpp deleted file mode 100644 index 79bffb0c8f..0000000000 --- a/cmd/dwi2noise.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. - * - * MRtrix is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * For more details, see http://www.mrtrix.org/. - */ - - -#include "command.h" -#include "image.h" -#include "phase_encoding.h" -#include "adapter/extract.h" -#include "dwi/gradient.h" -#include "math/least_squares.h" -#include "math/SH.h" - -#include "dwi/noise_estimator.h" - -using namespace MR; -using namespace App; - - -void usage () -{ - - AUTHOR = "J-Donald Tournier (jdtournier@gmail.com)"; - - SYNOPSIS = "Estimate noise level voxel-wise using residuals from a truncated SH fit"; - - DESCRIPTION - + "WARNING: This command is deprecated and may be removed in future releases. " - "Try using the dwidenoise command with the -noise option instead."; - - ARGUMENTS - + Argument ("dwi", - "the input diffusion-weighted image.") - .type_image_in () - - + Argument ("noise", - "the output noise map") - .type_image_out (); - - - - OPTIONS - + Option ("lmax", - "set the maximum harmonic order for the output series. By default, the " - "program will use the highest possible lmax given the number of " - "diffusion-weighted images, up to a maximum of 8.") - + Argument ("order").type_integer (0, 30) - - + DWI::GradImportOptions() - + DWI::ShellsOption; - -} - - -using value_type = float; - -void run () -{ - WARN ("Command dwi2noise is deprecated. Try using dwidenoise with -noise option instead."); - - auto dwi_in = Image::open (argument[0]); - const auto grad = DWI::get_valid_DW_scheme (dwi_in); - - vector dwis; - Eigen::MatrixXd mapping; - { - dwis = DWI::Shells (grad).select_shells (true, false, true).largest().get_volumes(); - const auto dirs = DWI::gen_direction_matrix (grad, dwis); - mapping = DWI::compute_SH2amp_mapping (dirs); - } - - auto dwi = Adapter::make (dwi_in, 3, container_cast> (dwis)); - - auto header = Header (dwi_in); - header.ndim() = 3; - header.datatype() = DataType::Float32; - DWI::stash_DW_scheme (header, grad); - PhaseEncoding::clear_scheme (header); - auto noise = Image::create (argument[1], header); - - DWI::estimate_noise (dwi, noise, mapping); -} - - diff --git a/docs/reference/commands/dwi2noise.rst b/docs/reference/commands/dwi2noise.rst deleted file mode 100644 index a5bdc2451e..0000000000 --- a/docs/reference/commands/dwi2noise.rst +++ /dev/null @@ -1,80 +0,0 @@ -.. _dwi2noise: - -dwi2noise -=================== - -Synopsis --------- - -Estimate noise level voxel-wise using residuals from a truncated SH fit - -Usage --------- - -:: - - dwi2noise [ options ] dwi noise - -- *dwi*: the input diffusion-weighted image. -- *noise*: the output noise map - -Description ------------ - -WARNING: This command is deprecated and may be removed in future releases. Try using the dwidenoise command with the -noise option instead. - -Options -------- - -- **-lmax order** set the maximum harmonic order for the output series. By default, the program will use the highest possible lmax given the number of diffusion-weighted images, up to a maximum of 8. - -DW gradient table import options -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -- **-grad file** Provide the diffusion-weighted gradient scheme used in the acquisition in a text file. This should be supplied as a 4xN text file with each line is in the format [ X Y Z b ], where [ X Y Z ] describe the direction of the applied gradient, and b gives the b-value in units of s/mm^2. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. - -- **-fslgrad bvecs bvals** Provide the diffusion-weighted gradient scheme used in the acquisition in FSL bvecs/bvals format files. If a diffusion gradient scheme is present in the input image header, the data provided with this option will be instead used. - -- **-bvalue_scaling mode** specifies whether the b-values should be scaled by the square of the corresponding DW gradient norm, as often required for multi-shell or DSI DW acquisition schemes. The default action can also be set in the MRtrix config file, under the BValueScaling entry. Valid choices are yes/no, true/false, 0/1 (default: true). - -DW shell selection options -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -- **-shells list** specify one or more diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. - -Standard options -^^^^^^^^^^^^^^^^ - -- **-info** display information messages. - -- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. - -- **-debug** display debugging messages. - -- **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. - -- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). - -- **-help** display this information page and exit. - -- **-version** display version information and exit. - --------------- - - - -**Author:** J-Donald Tournier (jdtournier@gmail.com) - -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. - -This Source Code Form is subject to the terms of the Mozilla Public -License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. - -MRtrix is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty -of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -For more details, see http://www.mrtrix.org/. - - diff --git a/docs/reference/commands_list.rst b/docs/reference/commands_list.rst index 1010e9191d..98c8d2e7a3 100644 --- a/docs/reference/commands_list.rst +++ b/docs/reference/commands_list.rst @@ -31,7 +31,6 @@ List of MRtrix3 commands commands/dwi2adc commands/dwi2fod commands/dwi2mask - commands/dwi2noise commands/dwi2tensor commands/dwidenoise commands/dwiextract @@ -143,7 +142,6 @@ List of MRtrix3 commands :ref:`dwi2adc`, "Convert mean dwi (trace-weighted) images to mean ADC maps" :ref:`dwi2fod`, "Estimate fibre orientation distributions from diffusion data using spherical deconvolution" :ref:`dwi2mask`, "Generates a whole brain mask from a DWI image" - :ref:`dwi2noise`, "Estimate noise level voxel-wise using residuals from a truncated SH fit" :ref:`dwi2tensor`, "Diffusion (kurtosis) tensor estimation using iteratively reweighted linear least squares estimator" :ref:`dwidenoise`, "Denoise DWI data and estimate the noise level based on the optimal threshold for PCA" :ref:`dwiextract`, "Extract diffusion-weighted volumes, b=0 volumes, or certain shells from a DWI dataset" From 33993dbcc92749ac24dd1e608d5eb59d608f2680 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Wed, 6 Dec 2017 18:24:57 +1100 Subject: [PATCH 256/538] remove dwi2noise test Note that the testing data, essentially noise.mif, is also used for the mrcrop tests; so it wasn't deleted. --- testing/tests/dwi2noise | 1 - 1 file changed, 1 deletion(-) delete mode 100644 testing/tests/dwi2noise diff --git a/testing/tests/dwi2noise b/testing/tests/dwi2noise deleted file mode 100644 index 64fcd5cf22..0000000000 --- a/testing/tests/dwi2noise +++ /dev/null @@ -1 +0,0 @@ -dwi2noise dwi.mif - | testing_diff_image - noise.mif -frac 1e-5 From d9e4ae7a138091e8a3a1097545c3e4c146335b75 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Thu, 7 Dec 2017 10:58:12 +1100 Subject: [PATCH 257/538] fod2dec -outputmap --> -contrast Further changes to the interface, functionality and default behaviour will happen at some point in the future. --- cmd/fod2dec.cpp | 15 ++++++++------- docs/reference/commands/fod2dec.rst | 10 +++++----- testing/tests/fod2dec | 12 ++++++------ 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/cmd/fod2dec.cpp b/cmd/fod2dec.cpp index d4d8582b94..27ec87328a 100644 --- a/cmd/fod2dec.cpp +++ b/cmd/fod2dec.cpp @@ -44,7 +44,7 @@ void usage () SYNOPSIS = "Generate FOD-based DEC maps, with optional panchromatic sharpening and/or luminance/perception correction"; DESCRIPTION - + "By default, the FOD-based DEC is weighted by the integral of the FOD. To weight by another scalar map, use the outputmap option. This option can also be used for panchromatic sharpening, e.g., by supplying a T1 (or other sensible) anatomical volume with a higher spatial resolution."; + + "By default, the FOD-based DEC is weighted by the integral of the FOD. To weight by another scalar map, use the -contrast option. This option can also be used for panchromatic sharpening, e.g., by supplying a T1 (or other sensible) anatomical volume with a higher spatial resolution."; REFERENCES + "Dhollander T, Smith RE, Tournier JD, Jeurissen B, Connelly A. " // Internal @@ -62,13 +62,10 @@ void usage () + Option ("mask","Only perform DEC computation within the specified mask image.") + Argument ("image").type_image_in() - + Option ("threshold","FOD amplitudes below the threshold value are considered zero.") - + Argument ("value").type_float() - - + Option ("outputmap","Weight the computed DEC map by a provided outputmap. If the outputmap has a different grid, the DEC map is first resliced and renormalised. To achieve panchromatic sharpening, provide an image with a higher spatial resolution than the input FOD image; e.g., a T1 anatomical volume. Only the DEC is subject to the mask, so as to allow for partial colouring of the outputmap. \nDefault when this option is *not* provided: integral of input FOD, subject to the same mask/threshold as used for DEC computation.") + + Option ("contrast","Weight the computed DEC map by the provided image contrast. If the contrast has a different image grid, the DEC map is first resliced and renormalised. To achieve panchromatic sharpening, provide an image with a higher spatial resolution than the input FOD image; e.g., a T1 anatomical volume. Only the DEC is subject to the mask, so as to allow for partial colouring of the contrast image. \nDefault when this option is *not* provided: integral of input FOD, subject to the same mask/threshold as used for DEC computation.") + Argument ("image").type_image_in() - + Option ("no_weight","Do not weight the DEC map (reslicing and renormalising still possible by explicitly providing the outputmap option as a template).") + + Option ("no_weight","Do not weight the DEC map (reslicing and renormalising of colours will still happen when providing the -contrast option as a template).") + Option ("lum","Correct for luminance/perception, using default values Cr,Cg,Cb = " + str(DEFAULT_LUM_CR, 2) + "," + str(DEFAULT_LUM_CG, 2) + "," + str(DEFAULT_LUM_CB, 2) + " and gamma = " + str(DEFAULT_LUM_GAMMA, 2) + " (*not* correcting is the theoretical equivalent of Cr,Cg,Cb = 1,1,1 and gamma = 2).") @@ -76,7 +73,11 @@ void usage () + Argument ("values").type_sequence_float() + Option ("lum_gamma","The gamma value to correct for luminance/perception. \nNote: this implicitly switches on luminance/perception correction, using a default Cr,Cg,Cb = " + str(DEFAULT_LUM_CR, 2) + "," + str(DEFAULT_LUM_CG, 2) + "," + str(DEFAULT_LUM_CB, 2) + " unless specified otherwise.") + + Argument ("value").type_float() + + + Option ("threshold","FOD amplitudes below the threshold value are considered zero.") + Argument ("value").type_float(); + } @@ -241,7 +242,7 @@ void run () { bool needtoslice = false; auto map_hdr = Header(); - auto opto = get_options ("outputmap"); + auto opto = get_options ("contrast"); if (opto.size()) { map_hdr = Header::open(opto[0][0]); if (!dimensions_match(map_hdr, fod_hdr, 0, 3) || diff --git a/docs/reference/commands/fod2dec.rst b/docs/reference/commands/fod2dec.rst index 3cee7dbdc5..2785d99262 100644 --- a/docs/reference/commands/fod2dec.rst +++ b/docs/reference/commands/fod2dec.rst @@ -21,18 +21,16 @@ Usage Description ----------- -By default, the FOD-based DEC is weighted by the integral of the FOD. To weight by another scalar map, use the outputmap option. This option can also be used for panchromatic sharpening, e.g., by supplying a T1 (or other sensible) anatomical volume with a higher spatial resolution. +By default, the FOD-based DEC is weighted by the integral of the FOD. To weight by another scalar map, use the -contrast option. This option can also be used for panchromatic sharpening, e.g., by supplying a T1 (or other sensible) anatomical volume with a higher spatial resolution. Options ------- - **-mask image** Only perform DEC computation within the specified mask image. -- **-threshold value** FOD amplitudes below the threshold value are considered zero. - -- **-outputmap image** Weight the computed DEC map by a provided outputmap. If the outputmap has a different grid, the DEC map is first resliced and renormalised. To achieve panchromatic sharpening, provide an image with a higher spatial resolution than the input FOD image; e.g., a T1 anatomical volume. Only the DEC is subject to the mask, so as to allow for partial colouring of the outputmap. Default when this option is *not* provided: integral of input FOD, subject to the same mask/threshold as used for DEC computation. +- **-contrast image** Weight the computed DEC map by the provided image contrast. If the contrast has a different image grid, the DEC map is first resliced and renormalised. To achieve panchromatic sharpening, provide an image with a higher spatial resolution than the input FOD image; e.g., a T1 anatomical volume. Only the DEC is subject to the mask, so as to allow for partial colouring of the contrast image. Default when this option is *not* provided: integral of input FOD, subject to the same mask/threshold as used for DEC computation. -- **-no_weight** Do not weight the DEC map (reslicing and renormalising still possible by explicitly providing the outputmap option as a template). +- **-no_weight** Do not weight the DEC map (reslicing and renormalising of colours will still happen when providing the -contrast option as a template). - **-lum** Correct for luminance/perception, using default values Cr,Cg,Cb = 0.3,0.5,0.2 and gamma = 2.2 (*not* correcting is the theoretical equivalent of Cr,Cg,Cb = 1,1,1 and gamma = 2). @@ -40,6 +38,8 @@ Options - **-lum_gamma value** The gamma value to correct for luminance/perception. Note: this implicitly switches on luminance/perception correction, using a default Cr,Cg,Cb = 0.3,0.5,0.2 unless specified otherwise. +- **-threshold value** FOD amplitudes below the threshold value are considered zero. + Standard options ^^^^^^^^^^^^^^^^ diff --git a/testing/tests/fod2dec b/testing/tests/fod2dec index 93845e46d9..d09ff7fe7b 100644 --- a/testing/tests/fod2dec +++ b/testing/tests/fod2dec @@ -4,9 +4,9 @@ fod2dec fod2dec/fod.mif - -threshold 0.06 | testing_diff_image - fod2dec/out/dec fod2dec fod2dec/fod.mif - -no_weight | testing_diff_image - fod2dec/out/dec_noweig.mif -voxel 1e-5 fod2dec fod2dec/fod.mif - -lum | testing_diff_image - fod2dec/out/dec_lum.mif -voxel 1e-5 fod2dec fod2dec/fod.mif - -mask fod2dec/roi.mif -threshold 0.07 -lum | testing_diff_image - fod2dec/out/dec_combo.mif -voxel 1e-5 -fod2dec fod2dec/fod.mif - -outputmap fod2dec/anat.mif | testing_diff_image - fod2dec/out/dec-anat.mif -voxel 1e-5 -fod2dec fod2dec/fod.mif - -outputmap fod2dec/anat.mif -mask fod2dec/roi.mif | testing_diff_image - fod2dec/out/dec-anat_masked.mif -voxel 1e-5 -fod2dec fod2dec/fod.mif - -outputmap fod2dec/anat.mif -threshold 0.06 | testing_diff_image - fod2dec/out/dec-anat_thresh.mif -voxel 1e-5 -fod2dec fod2dec/fod.mif - -outputmap fod2dec/anat.mif -no_weight | testing_diff_image - fod2dec/out/dec-anat_noweig.mif -voxel 1e-5 -fod2dec fod2dec/fod.mif - -outputmap fod2dec/anat.mif -lum | testing_diff_image - fod2dec/out/dec-anat_lum.mif -voxel 1e-5 -fod2dec fod2dec/fod.mif - -outputmap fod2dec/anat.mif -mask fod2dec/roi.mif -threshold 0.07 -lum | testing_diff_image - fod2dec/out/dec-anat_combo.mif -voxel 1e-5 +fod2dec fod2dec/fod.mif - -contrast fod2dec/anat.mif | testing_diff_image - fod2dec/out/dec-anat.mif -voxel 1e-5 +fod2dec fod2dec/fod.mif - -contrast fod2dec/anat.mif -mask fod2dec/roi.mif | testing_diff_image - fod2dec/out/dec-anat_masked.mif -voxel 1e-5 +fod2dec fod2dec/fod.mif - -contrast fod2dec/anat.mif -threshold 0.06 | testing_diff_image - fod2dec/out/dec-anat_thresh.mif -voxel 1e-5 +fod2dec fod2dec/fod.mif - -contrast fod2dec/anat.mif -no_weight | testing_diff_image - fod2dec/out/dec-anat_noweig.mif -voxel 1e-5 +fod2dec fod2dec/fod.mif - -contrast fod2dec/anat.mif -lum | testing_diff_image - fod2dec/out/dec-anat_lum.mif -voxel 1e-5 +fod2dec fod2dec/fod.mif - -contrast fod2dec/anat.mif -mask fod2dec/roi.mif -threshold 0.07 -lum | testing_diff_image - fod2dec/out/dec-anat_combo.mif -voxel 1e-5 From dea728d26c9f924d3334969bed26d9809b507332 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Thu, 7 Dec 2017 11:11:17 +1100 Subject: [PATCH 258/538] further fod2dec interface tweak --- cmd/fod2dec.cpp | 6 +++--- docs/reference/commands/fod2dec.rst | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/fod2dec.cpp b/cmd/fod2dec.cpp index 27ec87328a..37dd514100 100644 --- a/cmd/fod2dec.cpp +++ b/cmd/fod2dec.cpp @@ -65,8 +65,6 @@ void usage () + Option ("contrast","Weight the computed DEC map by the provided image contrast. If the contrast has a different image grid, the DEC map is first resliced and renormalised. To achieve panchromatic sharpening, provide an image with a higher spatial resolution than the input FOD image; e.g., a T1 anatomical volume. Only the DEC is subject to the mask, so as to allow for partial colouring of the contrast image. \nDefault when this option is *not* provided: integral of input FOD, subject to the same mask/threshold as used for DEC computation.") + Argument ("image").type_image_in() - + Option ("no_weight","Do not weight the DEC map (reslicing and renormalising of colours will still happen when providing the -contrast option as a template).") - + Option ("lum","Correct for luminance/perception, using default values Cr,Cg,Cb = " + str(DEFAULT_LUM_CR, 2) + "," + str(DEFAULT_LUM_CG, 2) + "," + str(DEFAULT_LUM_CB, 2) + " and gamma = " + str(DEFAULT_LUM_GAMMA, 2) + " (*not* correcting is the theoretical equivalent of Cr,Cg,Cb = 1,1,1 and gamma = 2).") + Option ("lum_coefs","The coefficients Cr,Cg,Cb to correct for luminance/perception. \nNote: this implicitly switches on luminance/perception correction, using a default gamma = " + str(DEFAULT_LUM_GAMMA, 2) + " unless specified otherwise.") @@ -76,7 +74,9 @@ void usage () + Argument ("value").type_float() + Option ("threshold","FOD amplitudes below the threshold value are considered zero.") - + Argument ("value").type_float(); + + Argument ("value").type_float() + + + Option ("no_weight","Do not weight the DEC map; just output the unweighted colours. Reslicing and renormalising of colours will still happen when providing the -contrast option as a template."); } diff --git a/docs/reference/commands/fod2dec.rst b/docs/reference/commands/fod2dec.rst index 2785d99262..d09a347566 100644 --- a/docs/reference/commands/fod2dec.rst +++ b/docs/reference/commands/fod2dec.rst @@ -30,8 +30,6 @@ Options - **-contrast image** Weight the computed DEC map by the provided image contrast. If the contrast has a different image grid, the DEC map is first resliced and renormalised. To achieve panchromatic sharpening, provide an image with a higher spatial resolution than the input FOD image; e.g., a T1 anatomical volume. Only the DEC is subject to the mask, so as to allow for partial colouring of the contrast image. Default when this option is *not* provided: integral of input FOD, subject to the same mask/threshold as used for DEC computation. -- **-no_weight** Do not weight the DEC map (reslicing and renormalising of colours will still happen when providing the -contrast option as a template). - - **-lum** Correct for luminance/perception, using default values Cr,Cg,Cb = 0.3,0.5,0.2 and gamma = 2.2 (*not* correcting is the theoretical equivalent of Cr,Cg,Cb = 1,1,1 and gamma = 2). - **-lum_coefs values** The coefficients Cr,Cg,Cb to correct for luminance/perception. Note: this implicitly switches on luminance/perception correction, using a default gamma = 2.2 unless specified otherwise. @@ -40,6 +38,8 @@ Options - **-threshold value** FOD amplitudes below the threshold value are considered zero. +- **-no_weight** Do not weight the DEC map; just output the unweighted colours. Reslicing and renormalising of colours will still happen when providing the -contrast option as a template. + Standard options ^^^^^^^^^^^^^^^^ From 716276863e040b22187e50d799a652f7bfc2a440 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Thu, 7 Dec 2017 13:15:52 +1100 Subject: [PATCH 259/538] tcknormalise --> tcktransform --- cmd/{tcknormalise.cpp => tcktransform.cpp} | 4 ++-- .../commands/{tcknormalise.rst => tcktransform.rst} | 8 ++++---- docs/reference/commands_list.rst | 4 ++-- docs/reference/mrtrix2_equivalent_commands.rst | 2 +- testing/data | 2 +- testing/tests/tcknormalise | 1 - testing/tests/tcktransform | 1 + 7 files changed, 11 insertions(+), 11 deletions(-) rename cmd/{tcknormalise.cpp => tcktransform.cpp} (95%) rename docs/reference/commands/{tcknormalise.rst => tcktransform.rst} (91%) delete mode 100644 testing/tests/tcknormalise create mode 100644 testing/tests/tcktransform diff --git a/cmd/tcknormalise.cpp b/cmd/tcktransform.cpp similarity index 95% rename from cmd/tcknormalise.cpp rename to cmd/tcktransform.cpp index c36120e390..6913378aae 100644 --- a/cmd/tcknormalise.cpp +++ b/cmd/tcktransform.cpp @@ -29,7 +29,7 @@ void usage () { AUTHOR = "J-Donald Tournier (jdtournier@gmail.com)"; - SYNOPSIS = "Apply a normalisation map to a tracks file"; + SYNOPSIS = "Apply a spatial transformation to a tracks file"; ARGUMENTS + Argument ("tracks", "the input track file.").type_tracks_in() @@ -91,7 +91,7 @@ class Warper { MEMALIGN(Warper) class Writer { MEMALIGN(Writer) public: Writer (const std::string& file, const Tractography::Properties& properties) : - progress ("normalising tracks"), + progress ("applying spatial transformation to tracks"), writer (file, properties) { } bool operator() (const TrackType& item) { diff --git a/docs/reference/commands/tcknormalise.rst b/docs/reference/commands/tcktransform.rst similarity index 91% rename from docs/reference/commands/tcknormalise.rst rename to docs/reference/commands/tcktransform.rst index 122e403bcd..ebdc42bb18 100644 --- a/docs/reference/commands/tcknormalise.rst +++ b/docs/reference/commands/tcktransform.rst @@ -1,19 +1,19 @@ -.. _tcknormalise: +.. _tcktransform: -tcknormalise +tcktransform =================== Synopsis -------- -Apply a normalisation map to a tracks file +Apply a spatial transformation to a tracks file Usage -------- :: - tcknormalise [ options ] tracks transform output + tcktransform [ options ] tracks transform output - *tracks*: the input track file. - *transform*: the image containing the transform. diff --git a/docs/reference/commands_list.rst b/docs/reference/commands_list.rst index 98c8d2e7a3..ac1323183d 100644 --- a/docs/reference/commands_list.rst +++ b/docs/reference/commands_list.rst @@ -95,12 +95,12 @@ List of MRtrix3 commands commands/tckglobal commands/tckinfo commands/tckmap - commands/tcknormalise commands/tckresample commands/tcksample commands/tcksift2 commands/tcksift commands/tckstats + commands/tcktransform commands/tensor2metric commands/transformcalc commands/transformcompose @@ -206,12 +206,12 @@ List of MRtrix3 commands :ref:`tckglobal`, "Multi-Shell Multi-Tissue Global Tractography" :ref:`tckinfo`, "Print out information about a track file" :ref:`tckmap`, "Use track data as a form of contrast for producing a high-resolution image" - :ref:`tcknormalise`, "Apply a normalisation map to a tracks file" :ref:`tckresample`, "Resample each streamline in a track file to a new set of vertices" :ref:`tcksample`, "Sample values of an associated image along tracks" :ref:`tcksift2`, "Successor to the SIFT method; instead of removing streamlines, use an EM framework to find an appropriate cross-section multiplier for each streamline" :ref:`tcksift`, "Filter a whole-brain fibre-tracking data set such that the streamline densities match the FOD lobe integrals" :ref:`tckstats`, "Calculate statistics on streamlines length" + :ref:`tcktransform`, "Apply a spatial transformation to a tracks file" :ref:`tensor2metric`, "Generate maps of tensor-derived parameters" :ref:`transformcalc`, "Perform calculations on linear transformation matrices" :ref:`transformcompose`, "Compose any number of linear transformations and/or warps into a single transformation" diff --git a/docs/reference/mrtrix2_equivalent_commands.rst b/docs/reference/mrtrix2_equivalent_commands.rst index f96754f40a..7ce6051b52 100644 --- a/docs/reference/mrtrix2_equivalent_commands.rst +++ b/docs/reference/mrtrix2_equivalent_commands.rst @@ -64,7 +64,7 @@ Further information can be found on these commands either through the `documenta +-----------------------+----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ``mrview`` | :ref:`mrview` | | +-----------------------+----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| ``normalise_tracks`` | :ref:`tcknormalise` | | +| ``normalise_tracks`` | :ref:`tcktransform` | | +-----------------------+----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | ``read_dicom`` | :ref:`dcminfo` | | +-----------------------+----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ diff --git a/testing/data b/testing/data index 5341f9e7df..037a7e9d1c 160000 --- a/testing/data +++ b/testing/data @@ -1 +1 @@ -Subproject commit 5341f9e7dfa9cf68199e838f85be75e7b83419b1 +Subproject commit 037a7e9d1ca36b002cd5403d5e59dc4bad75ebde diff --git a/testing/tests/tcknormalise b/testing/tests/tcknormalise deleted file mode 100644 index 5ac1c60af5..0000000000 --- a/testing/tests/tcknormalise +++ /dev/null @@ -1 +0,0 @@ -tcknormalise tracks.tck unit_warp.mif tmp.tck -force && testing_diff_tck tmp.tck tcknormalise/out.tck 1e-2 diff --git a/testing/tests/tcktransform b/testing/tests/tcktransform new file mode 100644 index 0000000000..5e622c4dbb --- /dev/null +++ b/testing/tests/tcktransform @@ -0,0 +1 @@ +tcktransform tracks.tck unit_warp.mif tmp.tck -force && testing_diff_tck tmp.tck tcktransform/out.tck 1e-2 From 7dac7d6aed0b14ed84aa6bfa2084bc9642d0842e Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Thu, 7 Dec 2017 22:46:24 +0000 Subject: [PATCH 260/538] NIfTI: check consistency of sform and qform As discussed in #1210 --- core/file/nifti1_utils.cpp | 41 ++++++++++++++++++++++++-------------- core/file/nifti2_utils.cpp | 34 +++++++++++++++++++++---------- core/image_helpers.h | 4 ++-- 3 files changed, 51 insertions(+), 28 deletions(-) diff --git a/core/file/nifti1_utils.cpp b/core/file/nifti1_utils.cpp index 5d0ad349dc..7abe613e87 100644 --- a/core/file/nifti1_utils.cpp +++ b/core/file/nifti1_utils.cpp @@ -145,7 +145,7 @@ namespace MR if (!std::isfinite (H.intensity_offset())) H.intensity_offset() = 0.0; } - else + else H.reset_intensity_scaling(); size_t data_offset = (size_t) Raw::fetch_ (&NH.vox_offset, is_BE); @@ -161,7 +161,8 @@ namespace MR } if (is_nifti) { - if (Raw::fetch_ (&NH.sform_code, is_BE)) { + bool sform_code = Raw::fetch_ (&NH.sform_code, is_BE); + if (sform_code) { auto& M (H.transform().matrix()); M(0,0) = Raw::fetch_ (&NH.srow_x[0], is_BE); @@ -195,21 +196,31 @@ namespace MR } } - else if (Raw::fetch_ (&NH.qform_code, is_BE)) { - { // TODO update with Eigen3 Quaternions - Eigen::Quaterniond Q (0.0, Raw::fetch_ (&NH.quatern_b, is_BE), Raw::fetch_ (&NH.quatern_c, is_BE), Raw::fetch_ (&NH.quatern_d, is_BE)); - Q.w() = std::sqrt (std::max (1.0 - Q.squaredNorm(), 0.0)); - H.transform().matrix().topLeftCorner<3,3>() = Q.matrix(); - } - H.transform().translation()[0] = Raw::fetch_ (&NH.qoffset_x, is_BE); - H.transform().translation()[1] = Raw::fetch_ (&NH.qoffset_y, is_BE); - H.transform().translation()[2] = Raw::fetch_ (&NH.qoffset_z, is_BE); + if (Raw::fetch_ (&NH.qform_code, is_BE)) { + transform_type M_qform; + + Eigen::Quaterniond Q (0.0, Raw::fetch_ (&NH.quatern_b, is_BE), Raw::fetch_ (&NH.quatern_c, is_BE), Raw::fetch_ (&NH.quatern_d, is_BE)); + Q.w() = std::sqrt (std::max (1.0 - Q.squaredNorm(), 0.0)); + M_qform.matrix().topLeftCorner<3,3>() = Q.matrix(); + + M_qform.translation()[0] = Raw::fetch_ (&NH.qoffset_x, is_BE); + M_qform.translation()[1] = Raw::fetch_ (&NH.qoffset_y, is_BE); + M_qform.translation()[2] = Raw::fetch_ (&NH.qoffset_z, is_BE); // qfac: float qfac = Raw::fetch_ (&NH.pixdim[0], is_BE) >= 0.0 ? 1.0 : -1.0; - if (qfac < 0.0) - H.transform().matrix().col(2) *= qfac; + if (qfac < 0.0) + M_qform.matrix().col(2) *= qfac; + + if (sform_code) { + Header header2 (H); + header2.transform() = M_qform; + if (!voxel_grids_match_in_scanner_space (H, header2)) + WARN ("sform and qform are inconsistent in NIfTI image \"" + H.name() + "\" - using sform"); + } + else + H.transform() = M_qform; } //CONF option: NIfTI.AutoLoadJSON @@ -287,7 +298,7 @@ namespace MR // pad out the other dimensions with 1, fix for fslview ++i; - for (; i < 8; i++) + for (; i < 8; i++) Raw::store (1, &NH.dim[i], is_BE); } @@ -383,7 +394,7 @@ namespace MR } Eigen::Quaterniond Q (R); - if (Q.w() < 0.0) + if (Q.w() < 0.0) Q.vec() = -Q.vec(); Raw::store (Q.x(), &NH.quatern_b, is_BE); diff --git a/core/file/nifti2_utils.cpp b/core/file/nifti2_utils.cpp index 90f2f88bb7..68595ab231 100644 --- a/core/file/nifti2_utils.cpp +++ b/core/file/nifti2_utils.cpp @@ -155,7 +155,8 @@ namespace MR // don't have to worry about whether or not the file is in // Analyse format; we can treat it as a NIfTI regardless of // whether the hedaer & data are in the same file or not. - if (Raw::fetch_ (&NH.sform_code, is_BE)) { + bool sform_code = Raw::fetch_ (&NH.sform_code, is_BE); + if (sform_code) { auto& M (H.transform().matrix()); M(0,0) = Raw::fetch_ (&NH.srow_x[0], is_BE); @@ -188,21 +189,32 @@ namespace MR M.col(axis).array() /= H.spacing (axis); } - } else if (Raw::fetch_ (&NH.qform_code, is_BE)) { - { // TODO update with Eigen3 Quaternions - Eigen::Quaterniond Q (0.0, Raw::fetch_ (&NH.quatern_b, is_BE), Raw::fetch_ (&NH.quatern_c, is_BE), Raw::fetch_ (&NH.quatern_d, is_BE)); - Q.w() = std::sqrt (std::max (1.0 - Q.squaredNorm(), 0.0)); - H.transform().matrix().topLeftCorner<3,3>() = Q.matrix(); - } + } + + if (Raw::fetch_ (&NH.qform_code, is_BE)) { + transform_type M_qform; + + Eigen::Quaterniond Q (0.0, Raw::fetch_ (&NH.quatern_b, is_BE), Raw::fetch_ (&NH.quatern_c, is_BE), Raw::fetch_ (&NH.quatern_d, is_BE)); + Q.w() = std::sqrt (std::max (1.0 - Q.squaredNorm(), 0.0)); + M_qform.matrix().topLeftCorner<3,3>() = Q.matrix(); - H.transform().translation()[0] = Raw::fetch_ (&NH.qoffset_x, is_BE); - H.transform().translation()[1] = Raw::fetch_ (&NH.qoffset_y, is_BE); - H.transform().translation()[2] = Raw::fetch_ (&NH.qoffset_z, is_BE); + M_qform.translation()[0] = Raw::fetch_ (&NH.qoffset_x, is_BE); + M_qform.translation()[1] = Raw::fetch_ (&NH.qoffset_y, is_BE); + M_qform.translation()[2] = Raw::fetch_ (&NH.qoffset_z, is_BE); // qfac: const float64 qfac = Raw::fetch_ (&NH.pixdim[0], is_BE) >= 0.0 ? 1.0 : -1.0; if (qfac < 0.0) - H.transform().matrix().col(2) *= qfac; + M_qform.matrix().col(2) *= qfac; + + if (sform_code) { + Header header2 (H); + header2.transform() = M_qform; + if (!voxel_grids_match_in_scanner_space (H, header2)) + WARN ("sform and qform are inconsistent in NIfTI image \"" + H.name() + "\" - using sform"); + } + else + H.transform() = M_qform; } if (File::Config::get_bool ("NIfTI.AutoLoadJSON", false)) { diff --git a/core/image_helpers.h b/core/image_helpers.h index dad79c5ab3..8984147689 100644 --- a/core/image_helpers.h +++ b/core/image_helpers.h @@ -406,7 +406,7 @@ namespace MR } template - inline void check_voxel_grids_match_in_scanner_space (const HeaderType1& in1, const HeaderType2& in2, const double tol = 1.0e-4) { + inline void check_voxel_grids_match_in_scanner_space (const HeaderType1& in1, const HeaderType2& in2, const double tol = 1.0e-3) { Eigen::IOFormat FullPrecFmt(Eigen::FullPrecision, 0, ", ", "\n", "[", "]"); if (!voxel_grids_match_in_scanner_space (in1, in2, tol)) throw Exception ("images \"" + in1.name() + "\" and \"" + in2.name() + "\" do not have matching header transforms " @@ -418,7 +418,7 @@ namespace MR //! tol: tolerance of FOV corner displacement in voxel units template inline bool voxel_grids_match_in_scanner_space (const HeaderType1 in1, const HeaderType2 in2, - const double tol = 1.0e-4) { + const double tol = 1.0e-3) { if (!dimensions_match(in1, in2, 0, 3)) return false; From 29dbf0255414c2a072e77dfbe72f6f10954ad185 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Mon, 11 Dec 2017 17:53:43 +1100 Subject: [PATCH 261/538] shellcounts to shell_sizes and shellvalues to shell_bvalues --- cmd/mrinfo.cpp | 46 +++++++++++++------------- docs/concepts/dw_scheme.rst | 2 +- docs/reference/commands/mrinfo.rst | 4 +-- lib/mrtrix3/dwi2response/dhollander.py | 6 ++-- lib/mrtrix3/dwi2response/manual.py | 2 +- lib/mrtrix3/dwi2response/msmt_5tt.py | 2 +- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/cmd/mrinfo.cpp b/cmd/mrinfo.cpp index bc195935d3..e51995b792 100644 --- a/cmd/mrinfo.cpp +++ b/cmd/mrinfo.cpp @@ -95,8 +95,8 @@ void usage () + GradExportOptions + Option ("dwgrad", "the diffusion-weighting gradient table, as stored in the header " "(i.e. without any interpretation, scaling of b-values, or normalisation of gradient vectors)") - + Option ("shellvalues", "list the average b-value of each shell") - + Option ("shellcounts", "list the number of volumes in each shell") + + Option ("shell_bvalues", "list the average b-value of each shell") + + Option ("shell_sizes", "list the number of volumes in each shell") + PhaseEncoding::ExportOptions + Option ("petable", "print the phase encoding table"); @@ -141,15 +141,15 @@ void print_strides (const Header& header) std::cout << buffer << "\n"; } -void print_shells (const Header& header, const bool shellvalues, const bool shellcounts) +void print_shells (const Header& header, const bool shell_bvalues, const bool shell_sizes) { DWI::Shells dwshells (DWI::parse_DW_scheme (header)); - if (shellvalues) { + if (shell_bvalues) { for (size_t i = 0; i < dwshells.count(); i++) std::cout << dwshells[i].get_mean() << " "; std::cout << "\n"; } - if (shellcounts) { + if (shell_sizes) { for (size_t i = 0; i < dwshells.count(); i++) std::cout << dwshells[i].count() << " "; std::cout << "\n"; @@ -273,32 +273,32 @@ void run () if (get_options ("norealign").size()) Header::do_not_realign_transform = true; - const bool format = get_options("format") .size(); - const bool ndim = get_options("ndim") .size(); - const bool size = get_options("size") .size(); - const bool spacing = get_options("spacing") .size(); - const bool datatype = get_options("datatype") .size(); - const bool strides = get_options("strides") .size(); - const bool offset = get_options("offset") .size(); - const bool multiplier = get_options("multiplier") .size(); - const auto properties = get_options("property"); - const bool transform = get_options("transform") .size(); - const bool dwgrad = get_options("dwgrad") .size(); - const bool shellvalues = get_options("shellvalues") .size(); - const bool shellcounts = get_options("shellcounts") .size(); - const bool raw_dwgrad = get_options("raw_dwgrad") .size(); - const bool petable = get_options("petable") .size(); + const bool format = get_options("format") .size(); + const bool ndim = get_options("ndim") .size(); + const bool size = get_options("size") .size(); + const bool spacing = get_options("spacing") .size(); + const bool datatype = get_options("datatype") .size(); + const bool strides = get_options("strides") .size(); + const bool offset = get_options("offset") .size(); + const bool multiplier = get_options("multiplier") .size(); + const auto properties = get_options("property"); + const bool transform = get_options("transform") .size(); + const bool dwgrad = get_options("dwgrad") .size(); + const bool shell_bvalues = get_options("shell_bvalues") .size(); + const bool shell_sizes = get_options("shell_sizes") .size(); + const bool raw_dwgrad = get_options("raw_dwgrad") .size(); + const bool petable = get_options("petable") .size(); const bool print_full_header = !(format || ndim || size || spacing || datatype || strides || offset || multiplier || properties.size() || transform || - dwgrad || export_grad || shellvalues || shellcounts || export_pe || petable || + dwgrad || export_grad || shell_bvalues || shell_sizes || export_pe || petable || json_keyval || json_all); for (size_t i = 0; i < argument.size(); ++i) { auto header = Header::open (argument[i]); if (raw_dwgrad) DWI::set_DW_scheme (header, DWI::get_DW_scheme (header)); - else if (export_grad || check_option_group (GradImportOptions) || dwgrad || shellvalues || shellcounts) + else if (export_grad || check_option_group (GradImportOptions) || dwgrad || shell_bvalues || shell_sizes) DWI::set_DW_scheme (header, DWI::get_valid_DW_scheme (header, true)); if (format) std::cout << header.format() << "\n"; @@ -311,7 +311,7 @@ void run () if (multiplier) std::cout << header.intensity_scale() << "\n"; if (transform) print_transform (header); if (dwgrad) std::cout << DWI::get_DW_scheme (header) << "\n"; - if (shellvalues || shellcounts) print_shells (header, shellvalues, shellcounts); + if (shell_bvalues || shell_sizes) print_shells (header, shell_bvalues, shell_sizes); if (petable) std::cout << PhaseEncoding::get_scheme (header) << "\n"; for (size_t n = 0; n < properties.size(); ++n) diff --git a/docs/concepts/dw_scheme.rst b/docs/concepts/dw_scheme.rst index 70af330e71..78e20cd390 100644 --- a/docs/concepts/dw_scheme.rst +++ b/docs/concepts/dw_scheme.rst @@ -296,7 +296,7 @@ These include: entries in the DW gradient table; - where relevant, verifying that the DW gradient tables contains the data in a shell structure, by clustering similar *b*-values together (see :ref:`mrinfo`'s - ``-shell`` and ``-shellcount`` options); + ``-shell_bvalues`` and ``-shell_sizes`` options); - normalising the gradient vectors to unit amplitude; - scaling the *b*-values by the square of the gradient vector amplitude - see `b-value scaling`_ for details. diff --git a/docs/reference/commands/mrinfo.rst b/docs/reference/commands/mrinfo.rst index 1a634c82fd..761764176f 100644 --- a/docs/reference/commands/mrinfo.rst +++ b/docs/reference/commands/mrinfo.rst @@ -80,9 +80,9 @@ DW gradient table export options - **-dwgrad** the diffusion-weighting gradient table, as stored in the header (i.e. without any interpretation, scaling of b-values, or normalisation of gradient vectors) -- **-shellvalues** list the average b-value of each shell +- **-shell_bvalues** list the average b-value of each shell -- **-shellcounts** list the number of volumes in each shell +- **-shell_sizes** list the number of volumes in each shell Options for exporting phase-encode tables ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/lib/mrtrix3/dwi2response/dhollander.py b/lib/mrtrix3/dwi2response/dhollander.py index 90ed40f4d5..8fc65eeaaf 100644 --- a/lib/mrtrix3/dwi2response/dhollander.py +++ b/lib/mrtrix3/dwi2response/dhollander.py @@ -38,8 +38,8 @@ def execute(): #pylint: disable=unused-variable # Get b-values and number of volumes per b-value. - bvalues = [ int(round(float(x))) for x in image.mrinfo('dwi.mif', 'shellvalues').split() ] - bvolumes = [ int(x) for x in image.mrinfo('dwi.mif', 'shellcounts').split() ] + bvalues = [ int(round(float(x))) for x in image.mrinfo('dwi.mif', 'shell_bvalues').split() ] + bvolumes = [ int(x) for x in image.mrinfo('dwi.mif', 'shell_sizes').split() ] app.console(str(len(bvalues)) + ' unique b-value(s) detected: ' + ','.join(map(str,bvalues)) + ' with ' + ','.join(map(str,bvolumes)) + ' volumes.') if len(bvalues) < 2: app.error('Need at least 2 unique b-values (including b=0).') @@ -72,7 +72,7 @@ def execute(): #pylint: disable=unused-variable zeropath = 'mean_b' + str(bvalues[0]) + '.mif' for i, b in enumerate(bvalues): meanpath = 'mean_b' + str(b) + '.mif' - run.command('dwiextract dwi.mif -shell ' + str(b) + ' - | mrmath - mean ' + meanpath + ' -axis 3') + run.command('dwiextract dwi.mif -shells ' + str(b) + ' - | mrmath - mean ' + meanpath + ' -axis 3') errpath = 'err_b' + str(b) + '.mif' run.command('mrcalc ' + meanpath + ' -finite ' + meanpath + ' 0 -if 0 -le ' + errpath + ' -datatype bit') errcmd += ' ' + errpath diff --git a/lib/mrtrix3/dwi2response/manual.py b/lib/mrtrix3/dwi2response/manual.py index 7035d62179..9b52745dab 100644 --- a/lib/mrtrix3/dwi2response/manual.py +++ b/lib/mrtrix3/dwi2response/manual.py @@ -36,7 +36,7 @@ def execute(): #pylint: disable=unused-variable import os, shutil from mrtrix3 import app, image, path, run - shells = [ int(round(float(x))) for x in image.mrinfo('dwi.mif', 'shellvalues').split() ] + shells = [ int(round(float(x))) for x in image.mrinfo('dwi.mif', 'shell_bvalues').split() ] # Get lmax information (if provided) lmax = [ ] diff --git a/lib/mrtrix3/dwi2response/msmt_5tt.py b/lib/mrtrix3/dwi2response/msmt_5tt.py index 9dff24a786..cd9c597426 100644 --- a/lib/mrtrix3/dwi2response/msmt_5tt.py +++ b/lib/mrtrix3/dwi2response/msmt_5tt.py @@ -46,7 +46,7 @@ def execute(): #pylint: disable=unused-variable run.command('5ttcheck 5tt.mif', False) # Get shell information - shells = [ int(round(float(x))) for x in image.mrinfo('dwi.mif', 'shellvalues').split() ] + shells = [ int(round(float(x))) for x in image.mrinfo('dwi.mif', 'shell_bvalues').split() ] if len(shells) < 3: app.warn('Less than three b-value shells; response functions will not be applicable in resolving three tissues using MSMT-CSD algorithm') From 858f17b45d7fac785e61e9a8a5b7d39d120c13e4 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Tue, 12 Dec 2017 11:54:31 +1100 Subject: [PATCH 262/538] tying up the remaining ends --- bin/dwishellmath | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/dwishellmath b/bin/dwishellmath index 9bed453354..45cb6f216b 100755 --- a/bin/dwishellmath +++ b/bin/dwishellmath @@ -22,10 +22,10 @@ HELP_PAGE fi tmpfiles="" -for b in $(mrinfo "$1" -shellvalues); +for b in $(mrinfo "$1" -shell_bvalues); do echo "Extracting $2 of the b=$b shell." - tmpfiles="$tmpfiles "$(dwiextract -shell $b "$1" - -quiet | mrmath -axis 3 - $2 - -quiet) + tmpfiles="$tmpfiles "$(dwiextract -shells $b "$1" - -quiet | mrmath -axis 3 - $2 - -quiet) done mrcat -axis 3 $tmpfiles "$3" -quiet From b4f4f4384675a2752c5f05e58d770893726389aa Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Wed, 13 Dec 2017 14:14:15 +1100 Subject: [PATCH 263/538] NIfTI config options change: no dots --- core/file/nifti1_utils.cpp | 8 ++++---- core/file/nifti2_utils.cpp | 2 +- core/file/nifti_utils.cpp | 8 ++++---- docs/reference/config_file_options.rst | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/file/nifti1_utils.cpp b/core/file/nifti1_utils.cpp index 5d0ad349dc..59b2a04ce4 100644 --- a/core/file/nifti1_utils.cpp +++ b/core/file/nifti1_utils.cpp @@ -212,11 +212,11 @@ namespace MR H.transform().matrix().col(2) *= qfac; } - //CONF option: NIfTI.AutoLoadJSON + //CONF option: NIfTIAutoLoadJSON //CONF default: 0 (false) //CONF A boolean value to indicate whether, when opening NIfTI images, //CONF any corresponding JSON file should be automatically loaded. - if (File::Config::get_bool ("NIfTI.AutoLoadJSON", false)) { + if (File::Config::get_bool ("NIfTIAutoLoadJSON", false)) { std::string json_path = H.name(); if (Path::has_suffix (json_path, ".nii.gz")) json_path = json_path.substr (0, json_path.size()-7); @@ -414,13 +414,13 @@ namespace MR strncpy ( (char*) &NH.magic, single_file ? "n+1\0" : "ni1\0", 4); - //CONF option: NIfTI.AutoSaveJSON + //CONF option: NIfTIAutoSaveJSON //CONF default: 0 (false) //CONF A boolean value to indicate whether, when writing NIfTI images, //CONF a corresponding JSON file should be automatically created in order //CONF to save any header entries that cannot be stored in the NIfTI //CONF header. - if (single_file && File::Config::get_bool ("NIfTI.AutoSaveJSON", false)) { + if (single_file && File::Config::get_bool ("NIfTIAutoSaveJSON", false)) { std::string json_path = H.name(); if (Path::has_suffix (json_path, ".nii.gz")) json_path = json_path.substr (0, json_path.size()-7); diff --git a/core/file/nifti2_utils.cpp b/core/file/nifti2_utils.cpp index 90f2f88bb7..9d1c987288 100644 --- a/core/file/nifti2_utils.cpp +++ b/core/file/nifti2_utils.cpp @@ -205,7 +205,7 @@ namespace MR H.transform().matrix().col(2) *= qfac; } - if (File::Config::get_bool ("NIfTI.AutoLoadJSON", false)) { + if (File::Config::get_bool ("NIfTIAutoLoadJSON", false)) { std::string json_path = H.name(); if (Path::has_suffix (json_path, ".nii.gz")) json_path = json_path.substr (0, json_path.size()-7); diff --git a/core/file/nifti_utils.cpp b/core/file/nifti_utils.cpp index 2e909f671a..fa819b19aa 100644 --- a/core/file/nifti_utils.cpp +++ b/core/file/nifti_utils.cpp @@ -98,14 +98,14 @@ namespace MR // by default, prevent output of bitwise data in NIfTI, since most 3rd // party software package can't handle them - //CONF option: NIFTI.AllowBitwise + //CONF option: NIfTIAllowBitwise //CONF default: 0 (false) //CONF A boolean value to indicate whether bitwise storage of binary //CONF data is permitted (most 3rd party software packages don't //CONF support bitwise data). If false (the default), data will be //CONF stored using more widely supported unsigned 8-bit integers. if (H.datatype() == DataType::Bit) - if (!File::Config::get_bool ("NIFTI.AllowBitwise", false)) + if (!File::Config::get_bool ("NIfTIAllowBitwise", false)) H.datatype() = DataType::UInt8; } @@ -116,7 +116,7 @@ namespace MR size_t version (Header& H) { - //CONF option: NIFTI.AlwaysUseVer2 + //CONF option: NIfTIAlwaysUseVer2 //CONF default: 0 (false) //CONF A boolean value to indicate whether NIfTI images should //CONF always be written in the new NIfTI-2 format. If false, @@ -125,7 +125,7 @@ namespace MR //CONF of voxels along any axis exceeds the maximum permissible //CONF in that format (32767), in which case the output file //CONF will automatically switch to the NIfTI-2 format. - if (File::Config::get_bool ("NIFTI.AlwaysUseVer2", false)) + if (File::Config::get_bool ("NIfTIAlwaysUseVer2", false)) return 2; for (size_t axis = 0; axis != H.ndim(); ++axis) { diff --git a/docs/reference/config_file_options.rst b/docs/reference/config_file_options.rst index fc11a7a696..84a5610187 100644 --- a/docs/reference/config_file_options.rst +++ b/docs/reference/config_file_options.rst @@ -329,22 +329,22 @@ List of MRtrix3 configuration file options How many samples to use for multi-sample anti-aliasing (to improve display quality). -* **NIFTI.AllowBitwise** +* **NIfTIAllowBitwise** *default: 0 (false)* A boolean value to indicate whether bitwise storage of binary data is permitted (most 3rd party software packages don't support bitwise data). If false (the default), data will be stored using more widely supported unsigned 8-bit integers. -* **NIFTI.AlwaysUseVer2** +* **NIfTIAlwaysUseVer2** *default: 0 (false)* A boolean value to indicate whether NIfTI images should always be written in the new NIfTI-2 format. If false, images will be written in the older NIfTI-1 format by default, with the exception being files where the number of voxels along any axis exceeds the maximum permissible in that format (32767), in which case the output file will automatically switch to the NIfTI-2 format. -* **NIfTI.AutoLoadJSON** +* **NIfTIAutoLoadJSON** *default: 0 (false)* A boolean value to indicate whether, when opening NIfTI images, any corresponding JSON file should be automatically loaded. -* **NIfTI.AutoSaveJSON** +* **NIfTIAutoSaveJSON** *default: 0 (false)* A boolean value to indicate whether, when writing NIfTI images, a corresponding JSON file should be automatically created in order to save any header entries that cannot be stored in the NIfTI header. From 87fe5055afab57b2769e43526c24ed28fe693fae Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Wed, 13 Dec 2017 14:31:55 +1100 Subject: [PATCH 264/538] reg_config_options to RegConfigOptions --- docs/reference/config_file_options.rst | 90 +++++++++++++------------- src/registration/linear.h | 36 +++++------ src/registration/transform/affine.h | 8 +-- src/registration/transform/rigid.h | 4 +- 4 files changed, 69 insertions(+), 69 deletions(-) diff --git a/docs/reference/config_file_options.rst b/docs/reference/config_file_options.rst index 84a5610187..1f3a431500 100644 --- a/docs/reference/config_file_options.rst +++ b/docs/reference/config_file_options.rst @@ -369,6 +369,51 @@ List of MRtrix3 configuration file options The default colour to use for objects (i.e. SH glyphs) when not colouring by direction. +* **RegAnalyseDescent** + *default: 0 (false)* + + Linear registration: write comma separated gradient descent parameters and gradients to stdout and verbose gradient descent output to stderr. + +* **RegCoherenceLen** + *default: 3.0* + + Linear registration: estimated spatial coherence length in voxels. + +* **RegGdConvergenceDataSmooth** + *default: 0.8* + + Linear registration: control point trajectory smoothing value used in convergence check parameter range: [0...1]. + +* **RegGdConvergenceMinIter** + *default: 10* + + Linear registration: minimum number of iterations until convergence check is activated. + +* **RegGdConvergenceSlopeSmooth** + *default: 0.1* + + Linear registration: control point trajectory slope smoothing value used in convergence check parameter range: [0...1]. + +* **RegGdConvergenceThresh** + *default: 5e-3* + + Linear registration: threshold for convergence check using the smoothed control point trajectories measured in fraction of a voxel. + +* **RegGdWeightMatrix** + *default: 0.0003* + + Linear registration: weight for optimisation of linear (3x3) matrix parameters. + +* **RegGdWeightTranslation** + *default: 1* + + Linear registration: weight for optimisation of translation parameters. + +* **RegStopLen** + *default: 0.0001* + + Linear registration: smallest gradient descent step measured in fraction of a voxel at which to stop registration. + * **ScriptTmpDir** *default: `.`* @@ -429,48 +474,3 @@ List of MRtrix3 configuration file options Whether the screen update should synchronise with the monitor's vertical refresh (to avoid tearing artefacts). -* **reg_analyse_descent** - *default: 0 (false)* - - Linear registration: write comma separated gradient descent parameters and gradients to stdout and verbose gradient descent output to stderr. - -* **reg_coherence_len** - *default: 3.0* - - Linear registration: estimated spatial coherence length in voxels. - -* **reg_gd_convergence_data_smooth** - *default: 0.8* - - Linear registration: control point trajectory smoothing value used in convergence check parameter range: [0...1]. - -* **reg_gd_convergence_min_iter** - *default: 10* - - Linear registration: minimum number of iterations until convergence check is activated. - -* **reg_gd_convergence_slope_smooth** - *default: 0.1* - - Linear registration: control point trajectory slope smoothing value used in convergence check parameter range: [0...1]. - -* **reg_gd_convergence_thresh** - *default: 5e-3* - - Linear registration: threshold for convergence check using the smoothed control point trajectories measured in fraction of a voxel. - -* **reg_gdweight_matrix** - *default: 0.0003* - - Linear registration: weight for optimisation of linear (3x3) matrix parameters. - -* **reg_gdweight_translation** - *default: 1* - - Linear registration: weight for optimisation of translation parameters. - -* **reg_stop_len** - *default: 0.0001* - - Linear registration: smallest gradient descent step measured in fraction of a voxel at which to stop registration. - diff --git a/src/registration/linear.h b/src/registration/linear.h index 5d5504a942..7757c01c08 100644 --- a/src/registration/linear.h +++ b/src/registration/linear.h @@ -111,11 +111,11 @@ namespace MR init_rotation_type (Transform::Init::none), robust_estimate (false), do_reorientation (false), - //CONF option: reg_analyse_descent + //CONF option: RegAnalyseDescent //CONF default: 0 (false) //CONF Linear registration: write comma separated gradient descent parameters and gradients //CONF to stdout and verbose gradient descent output to stderr. - analyse_descent (File::Config::get_bool ("reg_analyse_descent", false)) { + analyse_descent (File::Config::get_bool ("RegAnalyseDescent", false)) { stages[0].scale_factor = 0.25; stages[0].fod_lmax = 0; stages[1].scale_factor = 0.5; @@ -427,15 +427,15 @@ namespace MR midway_image_header.spacing(2)); Eigen::Vector3d coherence(spacing); Eigen::Vector3d stop(spacing); - //CONF option: reg_coherence_len + //CONF option: RegCoherenceLen //CONF default: 3.0 //CONF Linear registration: estimated spatial coherence length in voxels. - default_type reg_coherence_len = File::Config::get_float ("reg_coherence_len", 3.0); // = 3 stdev blur + default_type reg_coherence_len = File::Config::get_float ("RegCoherenceLen", 3.0); // = 3 stdev blur coherence *= reg_coherence_len * 1.0 / (2.0 * stage.scale_factor); - //CONF option: reg_stop_len + //CONF option: RegStopLen //CONF default: 0.0001 //CONF Linear registration: smallest gradient descent step measured in fraction of a voxel at which to stop registration. - default_type reg_stop_len = File::Config::get_float ("reg_stop_len", 0.0001); + default_type reg_stop_len = File::Config::get_float ("RegStopLen", 0.0001); stop.array() *= reg_stop_len; DEBUG ("coherence length: " + str(coherence)); DEBUG ("stop length: " + str(stop)); @@ -443,31 +443,31 @@ namespace MR // convergence check using slope of smoothed parameter trajectories Eigen::VectorXd slope_threshold = Eigen::VectorXd::Ones (12); - //CONF option: reg_gd_convergence_thresh + //CONF option: RegGdConvergenceThresh //CONF default: 5e-3 //CONF Linear registration: threshold for convergence check using the smoothed control point trajectories //CONF measured in fraction of a voxel. - slope_threshold.fill (spacing.mean() * File::Config::get_float ("reg_gd_convergence_thresh", 5e-3f)); + slope_threshold.fill (spacing.mean() * File::Config::get_float ("RegGdConvergenceThresh", 5e-3f)); DEBUG ("convergence slope threshold: " + str(slope_threshold[0])); - //CONF option: reg_gd_convergence_data_smooth + //CONF option: RegGdConvergenceDataSmooth //CONF default: 0.8 //CONF Linear registration: control point trajectory smoothing value used in convergence check //CONF parameter range: [0...1]. - const default_type alpha (MR::File::Config::get_float ("reg_gd_convergence_data_smooth", 0.8)); + const default_type alpha (MR::File::Config::get_float ("RegGdConvergenceDataSmooth", 0.8)); if ( (alpha < 0.0f ) || (alpha > 1.0f) ) - throw Exception ("config file option reg_gd_convergence_data_smooth has to be in the range: [0...1]"); - //CONF option: reg_gd_convergence_slope_smooth + throw Exception ("config file option RegGdConvergenceDataSmooth has to be in the range: [0...1]"); + //CONF option: RegGdConvergenceSlopeSmooth //CONF default: 0.1 //CONF Linear registration: control point trajectory slope smoothing value used in convergence check //CONF parameter range: [0...1]. - const default_type beta (MR::File::Config::get_float ("reg_gd_convergence_slope_smooth", 0.1)); + const default_type beta (MR::File::Config::get_float ("RegGdConvergenceSlopeSmooth", 0.1)); if ( (beta < 0.0f ) || (beta > 1.0f) ) - throw Exception ("config file option reg_gd_convergence_slope_smooth has to be in the range: [0...1]"); - size_t buffer_len (MR::File::Config::get_float ("reg_gd_convergence_buffer_len", 4)); - //CONF option: reg_gd_convergence_min_iter + throw Exception ("config file option RegGdConvergenceSlopeSmooth has to be in the range: [0...1]"); + size_t buffer_len (MR::File::Config::get_float ("RegGdConvergenceBufferLen", 4)); + //CONF option: RegGdConvergenceMinIter //CONF default: 10 //CONF Linear registration: minimum number of iterations until convergence check is activated. - size_t min_iter (MR::File::Config::get_float ("reg_gd_convergence_min_iter", 10)); + size_t min_iter (MR::File::Config::get_float ("RegGdConvergenceMinIter", 10)); transform.get_gradient_descent_updator()->set_convergence_check (slope_threshold, alpha, beta, buffer_len, min_iter); Metric::Evaluate evaluate (metric, parameters); @@ -506,7 +506,7 @@ namespace MR // Math::check_function_gradient (evaluate, params, 0.0001, true, optimiser_weights); if (stage.diagnostics_images.size()) { CONSOLE(" creating diagnostics image: " + stage.diagnostics_images[stage_iter - 1]); - parameters.make_diagnostics_image (stage.diagnostics_images[stage_iter - 1], File::Config::get_bool ("reg_linreg_diagnostics_image_masked", false)); + parameters.make_diagnostics_image (stage.diagnostics_images[stage_iter - 1], File::Config::get_bool ("RegLinregDiagnosticsImageMasked", false)); } } // update midway (affine average) space using the current transformations diff --git a/src/registration/transform/affine.h b/src/registration/transform/affine.h index 9855ecd283..5081f65531 100644 --- a/src/registration/transform/affine.h +++ b/src/registration/transform/affine.h @@ -102,14 +102,14 @@ namespace MR Affine () : Base (12) { - //CONF option: reg_gdweight_matrix + //CONF option: RegGdWeightMatrix //CONF default: 0.0003 //CONF Linear registration: weight for optimisation of linear (3x3) matrix parameters. - default_type w1 (MR::File::Config::get_float ("reg_gdweight_matrix", 0.0003f)); - //CONF option: reg_gdweight_translation + default_type w1 (MR::File::Config::get_float ("RegGdWeightMatrix", 0.0003f)); + //CONF option: RegGdWeightTranslation //CONF default: 1 //CONF Linear registration: weight for optimisation of translation parameters. - default_type w2 (MR::File::Config::get_float ("reg_gdweight_translation", 1.0f)); + default_type w2 (MR::File::Config::get_float ("RegGdWeightTranslation", 1.0f)); const Eigen::Vector4d weights (w1, w1, w1, w2); this->optimiser_weights << weights, weights, weights; } diff --git a/src/registration/transform/rigid.h b/src/registration/transform/rigid.h index acecbbaeaa..038f84ed93 100644 --- a/src/registration/transform/rigid.h +++ b/src/registration/transform/rigid.h @@ -89,8 +89,8 @@ namespace MR using has_robust_estimator = int; Rigid () : Base (12) { - default_type w1 (MR::File::Config::get_float ("reg_gdweight_matrix", 0.0003f)); - default_type w2 (MR::File::Config::get_float ("reg_gdweight_translation", 1.0f)); + default_type w1 (MR::File::Config::get_float ("RegGdWeightMatrix", 0.0003f)); + default_type w2 (MR::File::Config::get_float ("RegGdWeightTranslation", 1.0f)); const Eigen::Vector4d weights (w1, w1, w1, w2); this->optimiser_weights << weights, weights, weights; } From 6c6c553ed9e9004ca8495ece436fec4db465d82b Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Wed, 13 Dec 2017 15:09:37 +1100 Subject: [PATCH 265/538] Copyright update for upcoming RC which will probably end up around New Year's Also includes a change of mention of MRtrix to MRtrix3, in line with the phrase MRtrix3 developers, which was already in there/ Also includes removal of 2 .s, because they hindered clickability of the links in certain environments. --- cmd/5tt2gmwmi.cpp | 9 +-- cmd/5tt2vis.cpp | 9 +-- cmd/5ttcheck.cpp | 9 +-- cmd/5ttedit.cpp | 9 +-- cmd/afdconnectivity.cpp | 9 +-- cmd/amp2response.cpp | 9 +-- cmd/amp2sh.cpp | 9 +-- cmd/connectome2tck.cpp | 9 +-- cmd/connectomestats.cpp | 9 +-- cmd/dcmedit.cpp | 9 +-- cmd/dcminfo.cpp | 9 +-- cmd/dirflip.cpp | 9 +-- cmd/dirgen.cpp | 9 +-- cmd/dirmerge.cpp | 9 +-- cmd/dirorder.cpp | 9 +-- cmd/dirsplit.cpp | 9 +-- cmd/dirstat.cpp | 9 +-- cmd/dwi2adc.cpp | 9 +-- cmd/dwi2fod.cpp | 9 +-- cmd/dwi2mask.cpp | 9 +-- cmd/dwi2tensor.cpp | 9 +-- cmd/dwidenoise.cpp | 9 +-- cmd/dwiextract.cpp | 9 +-- cmd/dwinormalise.cpp | 9 +-- cmd/fixel2sh.cpp | 9 +-- cmd/fixel2tsf.cpp | 9 +-- cmd/fixel2voxel.cpp | 9 +-- cmd/fixelcfestats.cpp | 9 +-- cmd/fixelconvert.cpp | 9 +-- cmd/fixelcorrespondence.cpp | 9 +-- cmd/fixelcrop.cpp | 9 +-- cmd/fixelreorient.cpp | 9 +-- cmd/fod2dec.cpp | 9 +-- cmd/fod2fixel.cpp | 9 +-- cmd/label2colour.cpp | 9 +-- cmd/label2mesh.cpp | 9 +-- cmd/labelconvert.cpp | 9 +-- cmd/maskdump.cpp | 9 +-- cmd/maskfilter.cpp | 9 +-- cmd/mesh2voxel.cpp | 9 +-- cmd/meshconvert.cpp | 9 +-- cmd/meshfilter.cpp | 9 +-- cmd/mraverageheader.cpp | 9 +-- cmd/mrcalc.cpp | 9 +-- cmd/mrcat.cpp | 9 +-- cmd/mrcheckerboardmask.cpp | 9 +-- cmd/mrclusterstats.cpp | 9 +-- cmd/mrconvert.cpp | 9 +-- cmd/mrcrop.cpp | 9 +-- cmd/mrdegibbs.cpp | 9 +-- cmd/mrdump.cpp | 9 +-- cmd/mredit.cpp | 9 +-- cmd/mrfilter.cpp | 9 +-- cmd/mrhistmatch.cpp | 9 +-- cmd/mrhistogram.cpp | 9 +-- cmd/mrinfo.cpp | 9 +-- cmd/mrmath.cpp | 9 +-- cmd/mrmesh.cpp | 9 +-- cmd/mrmetric.cpp | 9 +-- cmd/mrpad.cpp | 9 +-- cmd/mrregister.cpp | 9 +-- cmd/mrresize.cpp | 9 +-- cmd/mrstats.cpp | 9 +-- cmd/mrthreshold.cpp | 9 +-- cmd/mrtransform.cpp | 9 +-- cmd/mrview.cpp | 9 +-- cmd/mtnormalise.cpp | 9 +-- cmd/peaks2amp.cpp | 9 +-- cmd/sh2amp.cpp | 9 +-- cmd/sh2peaks.cpp | 9 +-- cmd/sh2power.cpp | 9 +-- cmd/sh2response.cpp | 9 +-- cmd/shbasis.cpp | 9 +-- cmd/shconv.cpp | 9 +-- cmd/shview.cpp | 9 +-- cmd/tck2connectome.cpp | 9 +-- cmd/tck2fixel.cpp | 9 +-- cmd/tckconvert.cpp | 9 +-- cmd/tckdfc.cpp | 10 ++-- cmd/tckedit.cpp | 9 +-- cmd/tckgen.cpp | 9 +-- cmd/tckglobal.cpp | 9 +-- cmd/tckinfo.cpp | 9 +-- cmd/tckmap.cpp | 9 +-- cmd/tckresample.cpp | 9 +-- cmd/tcksample.cpp | 9 +-- cmd/tcksift.cpp | 9 +-- cmd/tcksift2.cpp | 9 +-- cmd/tckstats.cpp | 9 +-- cmd/tcktransform.cpp | 9 +-- cmd/tensor2metric.cpp | 9 +-- cmd/transformcalc.cpp | 9 +-- cmd/transformcompose.cpp | 9 +-- cmd/transformconvert.cpp | 9 +-- cmd/tsfdivide.cpp | 9 +-- cmd/tsfinfo.cpp | 9 +-- cmd/tsfmult.cpp | 9 +-- cmd/tsfsmooth.cpp | 9 +-- cmd/tsfthreshold.cpp | 9 +-- cmd/vectorstats.cpp | 9 +-- cmd/voxel2fixel.cpp | 9 +-- cmd/warp2metric.cpp | 9 +-- cmd/warpconvert.cpp | 9 +-- cmd/warpcorrect.cpp | 9 +-- cmd/warpinit.cpp | 9 +-- cmd/warpinvert.cpp | 9 +-- core/adapter/base.h | 9 +-- core/adapter/extract.h | 9 +-- core/adapter/gaussian1D.h | 9 +-- core/adapter/gradient1D.h | 9 +-- core/adapter/gradient3D.h | 9 +-- core/adapter/jacobian.h | 9 +-- core/adapter/median.h | 9 +-- core/adapter/neighbourhood3D.h | 9 +-- core/adapter/normalise3D.h | 9 +-- core/adapter/permute_axes.h | 9 +-- core/adapter/replicate.h | 9 +-- core/adapter/reslice.cpp | 9 +-- core/adapter/reslice.h | 9 +-- core/adapter/subset.h | 9 +-- core/adapter/warp.h | 9 +-- core/algo/copy.h | 9 +-- core/algo/histogram.cpp | 9 +-- core/algo/histogram.h | 9 +-- core/algo/iterator.h | 9 +-- core/algo/loop.h | 9 +-- core/algo/min_max.h | 9 +-- core/algo/neighbourhooditerator.h | 9 +-- core/algo/random_loop.h | 9 +-- core/algo/random_threaded_loop.h | 9 +-- core/algo/stochastic_threaded_loop.h | 9 +-- core/algo/threaded_copy.h | 9 +-- core/algo/threaded_loop.h | 9 +-- core/app.cpp | 17 +++--- core/app.h | 9 +-- core/apply.h | 9 +-- core/axes.cpp | 9 +-- core/axes.h | 9 +-- core/bitset.cpp | 9 +-- core/bitset.h | 9 +-- core/cmdline_option.h | 9 +-- core/command.h | 9 +-- core/datatype.cpp | 9 +-- core/datatype.h | 9 +-- core/debug.h | 9 +-- core/eigen_plugins/array.h | 9 +-- core/eigen_plugins/dense_base.h | 9 +-- core/eigen_plugins/matrix.h | 9 +-- core/exception.cpp | 9 +-- core/exception.h | 9 +-- core/file/config.cpp | 9 +-- core/file/config.h | 9 +-- core/file/copy.h | 9 +-- core/file/dicom/csa_entry.h | 9 +-- core/file/dicom/definitions.h | 9 +-- core/file/dicom/dict.cpp | 9 +-- core/file/dicom/element.cpp | 9 +-- core/file/dicom/element.h | 9 +-- core/file/dicom/image.cpp | 9 +-- core/file/dicom/image.h | 9 +-- core/file/dicom/mapper.cpp | 9 +-- core/file/dicom/mapper.h | 9 +-- core/file/dicom/patient.cpp | 9 +-- core/file/dicom/patient.h | 9 +-- core/file/dicom/quick_scan.cpp | 9 +-- core/file/dicom/quick_scan.h | 9 +-- core/file/dicom/select_cmdline.cpp | 9 +-- core/file/dicom/series.cpp | 9 +-- core/file/dicom/series.h | 9 +-- core/file/dicom/study.cpp | 9 +-- core/file/dicom/study.h | 9 +-- core/file/dicom/tree.cpp | 9 +-- core/file/dicom/tree.h | 9 +-- core/file/entry.h | 9 +-- core/file/gz.h | 9 +-- core/file/json_utils.cpp | 9 +-- core/file/json_utils.h | 9 +-- core/file/key_value.cpp | 9 +-- core/file/key_value.h | 9 +-- core/file/mgh.cpp | 9 +-- core/file/mgh.h | 9 +-- core/file/mmap.cpp | 9 +-- core/file/mmap.h | 9 +-- core/file/name_parser.cpp | 9 +-- core/file/name_parser.h | 9 +-- core/file/nifti1_utils.cpp | 9 +-- core/file/nifti1_utils.h | 9 +-- core/file/nifti2.h | 9 +-- core/file/nifti2_utils.cpp | 9 +-- core/file/nifti2_utils.h | 9 +-- core/file/nifti_utils.cpp | 9 +-- core/file/nifti_utils.h | 9 +-- core/file/ofstream.cpp | 9 +-- core/file/ofstream.h | 9 +-- core/file/path.h | 9 +-- core/file/tiff.cpp | 9 +-- core/file/tiff.h | 9 +-- core/file/utils.h | 9 +-- core/filter/base.h | 9 +-- core/filter/connected_components.h | 9 +-- core/filter/dilate.h | 9 +-- core/filter/dwi_brain_mask.h | 9 +-- core/filter/erode.h | 9 +-- core/filter/fft.h | 9 +-- core/filter/gradient.h | 9 +-- core/filter/mask_clean.h | 9 +-- core/filter/median.h | 9 +-- core/filter/normalise.h | 9 +-- core/filter/optimal_threshold.h | 9 +-- core/filter/resize.h | 9 +-- core/filter/reslice.h | 9 +-- core/filter/smooth.h | 9 +-- core/filter/warp.h | 9 +-- core/fixel/helpers.h | 9 +-- core/fixel/keys.h | 9 +-- core/fixel/legacy/fixel_metric.h | 9 +-- core/fixel/legacy/image.h | 9 +-- core/fixel/legacy/keys.h | 9 +-- core/fixel/loop.h | 9 +-- core/formats/analyse.cpp | 9 +-- core/formats/dicom.cpp | 9 +-- core/formats/list.cpp | 9 +-- core/formats/list.h | 9 +-- core/formats/mgh.cpp | 9 +-- core/formats/mgz.cpp | 9 +-- core/formats/mri.cpp | 9 +-- core/formats/mrtrix.cpp | 9 +-- core/formats/mrtrix_gz.cpp | 9 +-- core/formats/mrtrix_sparse_legacy.cpp | 9 +-- core/formats/mrtrix_utils.cpp | 9 +-- core/formats/mrtrix_utils.h | 9 +-- core/formats/nifti1.cpp | 9 +-- core/formats/nifti1_gz.cpp | 9 +-- core/formats/nifti2.cpp | 9 +-- core/formats/nifti2_gz.cpp | 9 +-- core/formats/pipe.cpp | 9 +-- core/formats/ram.cpp | 9 +-- core/formats/tiff.cpp | 9 +-- core/formats/xds.cpp | 9 +-- core/header.cpp | 9 +-- core/header.h | 9 +-- core/image.h | 9 +-- core/image_diff.h | 9 +-- core/image_helpers.h | 9 +-- core/image_io/base.cpp | 9 +-- core/image_io/base.h | 9 +-- core/image_io/default.cpp | 9 +-- core/image_io/default.h | 9 +-- core/image_io/fetch_store.cpp | 9 +-- core/image_io/fetch_store.h | 9 +-- core/image_io/gz.cpp | 9 +-- core/image_io/gz.h | 9 +-- core/image_io/mosaic.cpp | 9 +-- core/image_io/mosaic.h | 9 +-- core/image_io/pipe.cpp | 9 +-- core/image_io/pipe.h | 9 +-- core/image_io/ram.cpp | 9 +-- core/image_io/ram.h | 9 +-- core/image_io/scratch.cpp | 9 +-- core/image_io/scratch.h | 9 +-- core/image_io/sparse.cpp | 9 +-- core/image_io/sparse.h | 9 +-- core/image_io/tiff.cpp | 9 +-- core/image_io/tiff.h | 9 +-- core/interp/base.h | 9 +-- core/interp/cubic.h | 9 +-- core/interp/linear.h | 9 +-- core/interp/nearest.h | 9 +-- core/interp/sinc.h | 9 +-- core/math/SH.cpp | 9 +-- core/math/SH.h | 9 +-- core/math/Sn_scale_estimator.h | 9 +-- core/math/ZSH.h | 9 +-- core/math/average_space.cpp | 9 +-- core/math/average_space.h | 9 +-- core/math/bessel.cpp | 9 +-- core/math/bessel.h | 9 +-- core/math/cauchy.h | 9 +-- core/math/chebyshev.h | 9 +-- core/math/check_gradient.h | 9 +-- core/math/constrained_least_squares.h | 9 +-- core/math/cubic_spline.h | 9 +-- core/math/gaussian.h | 9 +-- core/math/golden_section_search.h | 9 +-- core/math/gradient_descent.h | 9 +-- core/math/gradient_descent_bb.h | 9 +-- core/math/hermite.h | 9 +-- core/math/least_squares.h | 9 +-- core/math/legendre.h | 9 +-- core/math/math.h | 9 +-- core/math/median.h | 9 +-- core/math/quadratic_line_search.h | 9 +-- core/math/rician.h | 9 +-- core/math/rng.h | 9 +-- core/math/sech.h | 9 +-- core/math/sinc.h | 9 +-- core/math/sphere.h | 9 +-- core/math/stats/glm.cpp | 9 +-- core/math/stats/glm.h | 9 +-- core/math/stats/permutation.cpp | 9 +-- core/math/stats/permutation.h | 9 +-- core/math/stats/typedefs.h | 9 +-- core/math/versor.h | 9 +-- core/memory.h | 9 +-- core/mrtrix.cpp | 9 +-- core/mrtrix.h | 9 +-- core/phase_encoding.cpp | 9 +-- core/phase_encoding.h | 9 +-- core/progressbar.cpp | 9 +-- core/progressbar.h | 9 +-- core/raw.h | 9 +-- core/signal_handler.cpp | 9 +-- core/signal_handler.h | 9 +-- core/signals.h | 9 +-- core/stats.cpp | 9 +-- core/stats.h | 9 +-- core/stride.cpp | 9 +-- core/stride.h | 9 +-- core/thread.cpp | 9 +-- core/thread.h | 9 +-- core/thread_queue.h | 9 +-- core/timer.h | 9 +-- core/transform.h | 9 +-- core/types.h | 9 +-- docs/reference/commands/5tt2gmwmi.rst | 8 +-- docs/reference/commands/5tt2vis.rst | 8 +-- docs/reference/commands/5ttcheck.rst | 8 +-- docs/reference/commands/5ttedit.rst | 8 +-- docs/reference/commands/afdconnectivity.rst | 8 +-- docs/reference/commands/amp2response.rst | 8 +-- docs/reference/commands/amp2sh.rst | 8 +-- docs/reference/commands/connectome2tck.rst | 8 +-- docs/reference/commands/connectomestats.rst | 8 +-- docs/reference/commands/dcmedit.rst | 8 +-- docs/reference/commands/dcminfo.rst | 8 +-- docs/reference/commands/dirflip.rst | 8 +-- docs/reference/commands/dirgen.rst | 8 +-- docs/reference/commands/dirmerge.rst | 8 +-- docs/reference/commands/dirorder.rst | 8 +-- docs/reference/commands/dirsplit.rst | 8 +-- docs/reference/commands/dirstat.rst | 8 +-- docs/reference/commands/dwi2adc.rst | 8 +-- docs/reference/commands/dwi2fod.rst | 8 +-- docs/reference/commands/dwi2mask.rst | 8 +-- docs/reference/commands/dwi2tensor.rst | 8 +-- docs/reference/commands/dwiextract.rst | 8 +-- docs/reference/commands/dwinormalise.rst | 8 +-- docs/reference/commands/fixel2sh.rst | 8 +-- docs/reference/commands/fixel2tsf.rst | 8 +-- docs/reference/commands/fixel2voxel.rst | 8 +-- docs/reference/commands/fixelcfestats.rst | 8 +-- docs/reference/commands/fixelconvert.rst | 8 +-- .../commands/fixelcorrespondence.rst | 8 +-- docs/reference/commands/fixelcrop.rst | 8 +-- docs/reference/commands/fixelreorient.rst | 8 +-- docs/reference/commands/fod2fixel.rst | 8 +-- docs/reference/commands/label2colour.rst | 8 +-- docs/reference/commands/label2mesh.rst | 8 +-- docs/reference/commands/labelconvert.rst | 8 +-- docs/reference/commands/maskdump.rst | 8 +-- docs/reference/commands/maskfilter.rst | 8 +-- docs/reference/commands/mesh2voxel.rst | 8 +-- docs/reference/commands/meshconvert.rst | 8 +-- docs/reference/commands/meshfilter.rst | 8 +-- docs/reference/commands/mraverageheader.rst | 8 +-- docs/reference/commands/mrcalc.rst | 8 +-- docs/reference/commands/mrcat.rst | 8 +-- .../reference/commands/mrcheckerboardmask.rst | 8 +-- docs/reference/commands/mrclusterstats.rst | 8 +-- docs/reference/commands/mrconvert.rst | 8 +-- docs/reference/commands/mrcrop.rst | 8 +-- docs/reference/commands/mrdegibbs.rst | 8 +-- docs/reference/commands/mrdump.rst | 8 +-- docs/reference/commands/mredit.rst | 8 +-- docs/reference/commands/mrfilter.rst | 8 +-- docs/reference/commands/mrhistmatch.rst | 8 +-- docs/reference/commands/mrhistogram.rst | 8 +-- docs/reference/commands/mrinfo.rst | 8 +-- docs/reference/commands/mrmath.rst | 8 +-- docs/reference/commands/mrmesh.rst | 8 +-- docs/reference/commands/mrmetric.rst | 8 +-- docs/reference/commands/mrpad.rst | 8 +-- docs/reference/commands/mrregister.rst | 8 +-- docs/reference/commands/mrresize.rst | 8 +-- docs/reference/commands/mrstats.rst | 8 +-- docs/reference/commands/mrthreshold.rst | 8 +-- docs/reference/commands/mrtransform.rst | 8 +-- docs/reference/commands/mrview.rst | 8 +-- docs/reference/commands/mtnormalise.rst | 8 +-- docs/reference/commands/peaks2amp.rst | 8 +-- docs/reference/commands/sh2amp.rst | 8 +-- docs/reference/commands/sh2peaks.rst | 8 +-- docs/reference/commands/sh2power.rst | 8 +-- docs/reference/commands/sh2response.rst | 8 +-- docs/reference/commands/shbasis.rst | 8 +-- docs/reference/commands/shconv.rst | 8 +-- docs/reference/commands/shview.rst | 8 +-- docs/reference/commands/tck2connectome.rst | 8 +-- docs/reference/commands/tck2fixel.rst | 8 +-- docs/reference/commands/tckconvert.rst | 8 +-- docs/reference/commands/tckdfc.rst | 8 +-- docs/reference/commands/tckedit.rst | 8 +-- docs/reference/commands/tckgen.rst | 8 +-- docs/reference/commands/tckinfo.rst | 8 +-- docs/reference/commands/tckmap.rst | 8 +-- docs/reference/commands/tckresample.rst | 8 +-- docs/reference/commands/tcksample.rst | 8 +-- docs/reference/commands/tcksift.rst | 8 +-- docs/reference/commands/tcksift2.rst | 8 +-- docs/reference/commands/tckstats.rst | 8 +-- docs/reference/commands/tcktransform.rst | 8 +-- docs/reference/commands/tensor2metric.rst | 8 +-- docs/reference/commands/transformcalc.rst | 8 +-- docs/reference/commands/transformcompose.rst | 8 +-- docs/reference/commands/transformconvert.rst | 8 +-- docs/reference/commands/tsfdivide.rst | 8 +-- docs/reference/commands/tsfinfo.rst | 8 +-- docs/reference/commands/tsfmult.rst | 8 +-- docs/reference/commands/tsfsmooth.rst | 8 +-- docs/reference/commands/tsfthreshold.rst | 8 +-- docs/reference/commands/vectorstats.rst | 8 +-- docs/reference/commands/voxel2fixel.rst | 8 +-- docs/reference/commands/warp2metric.rst | 8 +-- docs/reference/commands/warpconvert.rst | 8 +-- docs/reference/commands/warpcorrect.rst | 8 +-- docs/reference/commands/warpinit.rst | 8 +-- docs/reference/commands/warpinvert.rst | 8 +-- docs/reference/scripts/5ttgen.rst | 24 ++++---- docs/reference/scripts/dwi2response.rst | 56 +++++++++---------- docs/reference/scripts/dwibiascorrect.rst | 8 +-- docs/reference/scripts/dwigradcheck.rst | 8 +-- docs/reference/scripts/dwiintensitynorm.rst | 8 +-- docs/reference/scripts/dwipreproc.rst | 8 +-- docs/reference/scripts/labelsgmfix.rst | 8 +-- .../reference/scripts/population_template.rst | 8 +-- lib/mrtrix3/app.py | 8 +-- src/connectome/connectome.cpp | 9 +-- src/connectome/connectome.h | 9 +-- src/connectome/enhance.cpp | 9 +-- src/connectome/enhance.h | 9 +-- src/connectome/lut.cpp | 9 +-- src/connectome/lut.h | 9 +-- src/connectome/mat2vec.h | 9 +-- src/dwi/bootstrap.h | 9 +-- src/dwi/directions/file.cpp | 9 +-- src/dwi/directions/file.h | 9 +-- src/dwi/directions/mask.cpp | 9 +-- src/dwi/directions/mask.h | 9 +-- src/dwi/directions/predefined.cpp | 9 +-- src/dwi/directions/predefined.h | 9 +-- src/dwi/directions/set.cpp | 9 +-- src/dwi/directions/set.h | 9 +-- src/dwi/fixel_map.h | 9 +-- src/dwi/fmls.cpp | 9 +-- src/dwi/fmls.h | 9 +-- src/dwi/gradient.cpp | 9 +-- src/dwi/gradient.h | 9 +-- src/dwi/noise_estimator.h | 9 +-- src/dwi/sdeconv/csd.cpp | 9 +-- src/dwi/sdeconv/csd.h | 9 +-- src/dwi/sdeconv/msmt_csd.h | 9 +-- src/dwi/shells.cpp | 9 +-- src/dwi/shells.h | 9 +-- src/dwi/tensor.h | 9 +-- src/dwi/tractography/ACT/act.cpp | 9 +-- src/dwi/tractography/ACT/act.h | 9 +-- src/dwi/tractography/ACT/gmwmi.cpp | 9 +-- src/dwi/tractography/ACT/gmwmi.h | 9 +-- src/dwi/tractography/ACT/method.h | 9 +-- src/dwi/tractography/ACT/shared.h | 9 +-- src/dwi/tractography/ACT/tissues.h | 9 +-- src/dwi/tractography/GT/energy.h | 9 +-- src/dwi/tractography/GT/externalenergy.cpp | 9 +-- src/dwi/tractography/GT/externalenergy.h | 9 +-- src/dwi/tractography/GT/gt.cpp | 9 +-- src/dwi/tractography/GT/gt.h | 9 +-- src/dwi/tractography/GT/internalenergy.cpp | 9 +-- src/dwi/tractography/GT/internalenergy.h | 9 +-- src/dwi/tractography/GT/mhsampler.cpp | 9 +-- src/dwi/tractography/GT/mhsampler.h | 9 +-- src/dwi/tractography/GT/particle.cpp | 9 +-- src/dwi/tractography/GT/particle.h | 9 +-- src/dwi/tractography/GT/particlegrid.cpp | 9 +-- src/dwi/tractography/GT/particlegrid.h | 9 +-- src/dwi/tractography/GT/particlepool.h | 9 +-- src/dwi/tractography/GT/spatiallock.h | 9 +-- src/dwi/tractography/SIFT/fixel.h | 9 +-- src/dwi/tractography/SIFT/gradient_sort.cpp | 9 +-- src/dwi/tractography/SIFT/gradient_sort.h | 9 +-- src/dwi/tractography/SIFT/model.h | 9 +-- src/dwi/tractography/SIFT/model_base.h | 9 +-- src/dwi/tractography/SIFT/output.h | 9 +-- src/dwi/tractography/SIFT/proc_mask.cpp | 9 +-- src/dwi/tractography/SIFT/proc_mask.h | 9 +-- src/dwi/tractography/SIFT/sift.cpp | 9 +-- src/dwi/tractography/SIFT/sift.h | 9 +-- src/dwi/tractography/SIFT/sifter.cpp | 9 +-- src/dwi/tractography/SIFT/sifter.h | 9 +-- .../tractography/SIFT/track_contribution.cpp | 9 +-- .../tractography/SIFT/track_contribution.h | 9 +-- .../tractography/SIFT/track_index_range.cpp | 9 +-- src/dwi/tractography/SIFT/track_index_range.h | 9 +-- src/dwi/tractography/SIFT/types.h | 9 +-- .../tractography/SIFT2/coeff_optimiser.cpp | 9 +-- src/dwi/tractography/SIFT2/coeff_optimiser.h | 9 +-- src/dwi/tractography/SIFT2/fixel.h | 9 +-- src/dwi/tractography/SIFT2/fixel_updater.cpp | 9 +-- src/dwi/tractography/SIFT2/fixel_updater.h | 9 +-- src/dwi/tractography/SIFT2/line_search.cpp | 9 +-- src/dwi/tractography/SIFT2/line_search.h | 9 +-- src/dwi/tractography/SIFT2/reg_calculator.cpp | 9 +-- src/dwi/tractography/SIFT2/reg_calculator.h | 9 +-- src/dwi/tractography/SIFT2/regularisation.h | 9 +-- .../tractography/SIFT2/streamline_stats.cpp | 9 +-- src/dwi/tractography/SIFT2/streamline_stats.h | 9 +-- src/dwi/tractography/SIFT2/tckfactor.cpp | 9 +-- src/dwi/tractography/SIFT2/tckfactor.h | 9 +-- src/dwi/tractography/algorithms/calibrator.h | 9 +-- src/dwi/tractography/algorithms/fact.h | 9 +-- src/dwi/tractography/algorithms/iFOD1.h | 9 +-- src/dwi/tractography/algorithms/iFOD2.cpp | 9 +-- src/dwi/tractography/algorithms/iFOD2.h | 9 +-- src/dwi/tractography/algorithms/nulldist.h | 9 +-- src/dwi/tractography/algorithms/sd_stream.h | 9 +-- src/dwi/tractography/algorithms/seedtest.h | 9 +-- src/dwi/tractography/algorithms/tensor_det.h | 9 +-- src/dwi/tractography/algorithms/tensor_prob.h | 9 +-- .../tractography/connectome/connectome.cpp | 9 +-- src/dwi/tractography/connectome/connectome.h | 9 +-- src/dwi/tractography/connectome/exemplar.cpp | 9 +-- src/dwi/tractography/connectome/exemplar.h | 9 +-- src/dwi/tractography/connectome/extract.cpp | 9 +-- src/dwi/tractography/connectome/extract.h | 9 +-- .../tractography/connectome/mapped_track.h | 9 +-- src/dwi/tractography/connectome/mapper.h | 9 +-- src/dwi/tractography/connectome/matrix.cpp | 9 +-- src/dwi/tractography/connectome/matrix.h | 9 +-- src/dwi/tractography/connectome/metric.h | 9 +-- src/dwi/tractography/connectome/streamline.h | 9 +-- src/dwi/tractography/connectome/tck2nodes.cpp | 9 +-- src/dwi/tractography/connectome/tck2nodes.h | 9 +-- src/dwi/tractography/editing/editing.cpp | 9 +-- src/dwi/tractography/editing/editing.h | 9 +-- src/dwi/tractography/editing/loader.h | 9 +-- src/dwi/tractography/editing/receiver.cpp | 9 +-- src/dwi/tractography/editing/receiver.h | 9 +-- src/dwi/tractography/editing/worker.cpp | 9 +-- src/dwi/tractography/editing/worker.h | 9 +-- src/dwi/tractography/file.h | 9 +-- src/dwi/tractography/file_base.cpp | 9 +-- src/dwi/tractography/file_base.h | 9 +-- .../mapping/buffer_scratch_dump.h | 9 +-- src/dwi/tractography/mapping/fixel_td_map.cpp | 9 +-- src/dwi/tractography/mapping/fixel_td_map.h | 9 +-- .../tractography/mapping/gaussian/mapper.cpp | 9 +-- .../tractography/mapping/gaussian/mapper.h | 9 +-- src/dwi/tractography/mapping/gaussian/voxel.h | 9 +-- src/dwi/tractography/mapping/loader.h | 9 +-- src/dwi/tractography/mapping/mapper.cpp | 9 +-- src/dwi/tractography/mapping/mapper.h | 9 +-- .../tractography/mapping/mapper_plugins.cpp | 9 +-- src/dwi/tractography/mapping/mapper_plugins.h | 9 +-- src/dwi/tractography/mapping/mapping.cpp | 9 +-- src/dwi/tractography/mapping/mapping.h | 9 +-- src/dwi/tractography/mapping/twi_stats.cpp | 9 +-- src/dwi/tractography/mapping/twi_stats.h | 9 +-- src/dwi/tractography/mapping/voxel.cpp | 9 +-- src/dwi/tractography/mapping/voxel.h | 9 +-- src/dwi/tractography/mapping/writer.cpp | 9 +-- src/dwi/tractography/mapping/writer.h | 9 +-- src/dwi/tractography/properties.cpp | 9 +-- src/dwi/tractography/properties.h | 9 +-- src/dwi/tractography/resampling/arc.cpp | 9 +-- src/dwi/tractography/resampling/arc.h | 9 +-- .../tractography/resampling/downsampler.cpp | 9 +-- src/dwi/tractography/resampling/downsampler.h | 9 +-- src/dwi/tractography/resampling/endpoints.cpp | 9 +-- src/dwi/tractography/resampling/endpoints.h | 9 +-- .../resampling/fixed_num_points.cpp | 9 +-- .../resampling/fixed_num_points.h | 9 +-- .../resampling/fixed_step_size.cpp | 9 +-- .../tractography/resampling/fixed_step_size.h | 9 +-- .../tractography/resampling/resampling.cpp | 9 +-- src/dwi/tractography/resampling/resampling.h | 9 +-- src/dwi/tractography/resampling/upsampler.cpp | 9 +-- src/dwi/tractography/resampling/upsampler.h | 9 +-- src/dwi/tractography/rng.cpp | 9 +-- src/dwi/tractography/rng.h | 9 +-- src/dwi/tractography/roi.cpp | 9 +-- src/dwi/tractography/roi.h | 9 +-- src/dwi/tractography/scalar_file.h | 9 +-- src/dwi/tractography/seeding/base.h | 9 +-- src/dwi/tractography/seeding/basic.cpp | 9 +-- src/dwi/tractography/seeding/basic.h | 9 +-- src/dwi/tractography/seeding/dynamic.cpp | 9 +-- src/dwi/tractography/seeding/dynamic.h | 9 +-- src/dwi/tractography/seeding/gmwmi.cpp | 9 +-- src/dwi/tractography/seeding/gmwmi.h | 9 +-- src/dwi/tractography/seeding/list.cpp | 9 +-- src/dwi/tractography/seeding/list.h | 9 +-- src/dwi/tractography/seeding/seeding.cpp | 9 +-- src/dwi/tractography/seeding/seeding.h | 9 +-- src/dwi/tractography/streamline.h | 9 +-- src/dwi/tractography/tracking/early_exit.cpp | 9 +-- src/dwi/tractography/tracking/early_exit.h | 9 +-- src/dwi/tractography/tracking/exec.h | 9 +-- .../tractography/tracking/generated_track.h | 9 +-- src/dwi/tractography/tracking/method.cpp | 9 +-- src/dwi/tractography/tracking/method.h | 9 +-- src/dwi/tractography/tracking/shared.cpp | 9 +-- src/dwi/tractography/tracking/shared.h | 9 +-- .../tractography/tracking/tractography.cpp | 9 +-- src/dwi/tractography/tracking/tractography.h | 9 +-- src/dwi/tractography/tracking/types.h | 9 +-- .../tractography/tracking/write_kernel.cpp | 9 +-- src/dwi/tractography/tracking/write_kernel.h | 9 +-- src/dwi/tractography/weights.cpp | 9 +-- src/dwi/tractography/weights.h | 9 +-- src/gui/color_button.cpp | 9 +-- src/gui/color_button.h | 9 +-- src/gui/cursor.cpp | 9 +-- src/gui/cursor.h | 9 +-- src/gui/dialog/dialog.cpp | 9 +-- src/gui/dialog/dialog.h | 9 +-- src/gui/dialog/dicom.cpp | 9 +-- src/gui/dialog/dicom.h | 9 +-- src/gui/dialog/file.cpp | 9 +-- src/gui/dialog/file.h | 9 +-- src/gui/dialog/image_properties.cpp | 9 +-- src/gui/dialog/image_properties.h | 9 +-- src/gui/dialog/list.cpp | 9 +-- src/gui/dialog/list.h | 9 +-- src/gui/dialog/opengl.cpp | 9 +-- src/gui/dialog/opengl.h | 9 +-- src/gui/dialog/progress.cpp | 9 +-- src/gui/dialog/progress.h | 9 +-- src/gui/dialog/report_exception.cpp | 9 +-- src/gui/dialog/report_exception.h | 9 +-- src/gui/dwi/render_frame.cpp | 9 +-- src/gui/dwi/render_frame.h | 9 +-- src/gui/dwi/renderer.cpp | 9 +-- src/gui/dwi/renderer.h | 9 +-- src/gui/gui.cpp | 9 +-- src/gui/gui.h | 9 +-- src/gui/lighting_dock.cpp | 9 +-- src/gui/lighting_dock.h | 9 +-- src/gui/mrview/adjust_button.cpp | 9 +-- src/gui/mrview/adjust_button.h | 9 +-- src/gui/mrview/colourmap.cpp | 9 +-- src/gui/mrview/colourmap.h | 9 +-- src/gui/mrview/colourmap_button.cpp | 9 +-- src/gui/mrview/colourmap_button.h | 9 +-- src/gui/mrview/combo_box_error.cpp | 9 +-- src/gui/mrview/combo_box_error.h | 9 +-- src/gui/mrview/displayable.cpp | 9 +-- src/gui/mrview/displayable.h | 9 +-- src/gui/mrview/gui_image.cpp | 9 +-- src/gui/mrview/gui_image.h | 9 +-- src/gui/mrview/icons.h | 9 +-- src/gui/mrview/mode/base.cpp | 9 +-- src/gui/mrview/mode/base.h | 9 +-- src/gui/mrview/mode/lightbox.cpp | 9 +-- src/gui/mrview/mode/lightbox.h | 9 +-- src/gui/mrview/mode/lightbox_gui.h | 9 +-- src/gui/mrview/mode/list.h | 9 +-- src/gui/mrview/mode/ortho.cpp | 9 +-- src/gui/mrview/mode/ortho.h | 9 +-- src/gui/mrview/mode/slice.cpp | 9 +-- src/gui/mrview/mode/slice.h | 9 +-- src/gui/mrview/mode/volume.cpp | 9 +-- src/gui/mrview/mode/volume.h | 9 +-- src/gui/mrview/spin_box.h | 9 +-- src/gui/mrview/tool/base.cpp | 9 +-- src/gui/mrview/tool/base.h | 9 +-- .../tool/connectome/colourmap_observers.cpp | 9 +-- .../tool/connectome/colourmap_observers.h | 9 +-- src/gui/mrview/tool/connectome/connectome.cpp | 9 +-- src/gui/mrview/tool/connectome/connectome.h | 9 +-- src/gui/mrview/tool/connectome/edge.cpp | 9 +-- src/gui/mrview/tool/connectome/edge.h | 9 +-- .../tool/connectome/file_data_vector.cpp | 9 +-- .../mrview/tool/connectome/file_data_vector.h | 9 +-- .../mrview/tool/connectome/matrix_list.cpp | 9 +-- src/gui/mrview/tool/connectome/matrix_list.h | 9 +-- src/gui/mrview/tool/connectome/node.cpp | 9 +-- src/gui/mrview/tool/connectome/node.h | 9 +-- src/gui/mrview/tool/connectome/node_list.cpp | 9 +-- src/gui/mrview/tool/connectome/node_list.h | 9 +-- .../mrview/tool/connectome/node_overlay.cpp | 9 +-- src/gui/mrview/tool/connectome/node_overlay.h | 9 +-- src/gui/mrview/tool/connectome/selection.cpp | 9 +-- src/gui/mrview/tool/connectome/selection.h | 9 +-- src/gui/mrview/tool/connectome/shaders.cpp | 9 +-- src/gui/mrview/tool/connectome/shaders.h | 9 +-- src/gui/mrview/tool/connectome/types.h | 9 +-- src/gui/mrview/tool/fixel/base_fixel.cpp | 9 +-- src/gui/mrview/tool/fixel/base_fixel.h | 9 +-- src/gui/mrview/tool/fixel/directory.cpp | 9 +-- src/gui/mrview/tool/fixel/directory.h | 9 +-- src/gui/mrview/tool/fixel/fixel.cpp | 9 +-- src/gui/mrview/tool/fixel/fixel.h | 9 +-- src/gui/mrview/tool/fixel/image4D.cpp | 9 +-- src/gui/mrview/tool/fixel/image4D.h | 9 +-- src/gui/mrview/tool/fixel/legacy.cpp | 9 +-- src/gui/mrview/tool/fixel/legacy.h | 9 +-- src/gui/mrview/tool/fixel/vector_structs.h | 9 +-- src/gui/mrview/tool/list.h | 9 +-- src/gui/mrview/tool/list_model_base.h | 9 +-- src/gui/mrview/tool/odf/item.cpp | 9 +-- src/gui/mrview/tool/odf/item.h | 9 +-- src/gui/mrview/tool/odf/model.cpp | 9 +-- src/gui/mrview/tool/odf/model.h | 9 +-- src/gui/mrview/tool/odf/odf.cpp | 9 +-- src/gui/mrview/tool/odf/odf.h | 9 +-- src/gui/mrview/tool/odf/preview.cpp | 9 +-- src/gui/mrview/tool/odf/preview.h | 9 +-- src/gui/mrview/tool/odf/type.h | 9 +-- src/gui/mrview/tool/overlay.cpp | 9 +-- src/gui/mrview/tool/overlay.h | 9 +-- src/gui/mrview/tool/roi_editor/item.cpp | 9 +-- src/gui/mrview/tool/roi_editor/item.h | 9 +-- src/gui/mrview/tool/roi_editor/model.cpp | 9 +-- src/gui/mrview/tool/roi_editor/model.h | 9 +-- src/gui/mrview/tool/roi_editor/roi.cpp | 9 +-- src/gui/mrview/tool/roi_editor/roi.h | 9 +-- src/gui/mrview/tool/roi_editor/undoentry.cpp | 9 +-- src/gui/mrview/tool/roi_editor/undoentry.h | 9 +-- src/gui/mrview/tool/screen_capture.cpp | 9 +-- src/gui/mrview/tool/screen_capture.h | 9 +-- .../tool/tractography/track_scalar_file.cpp | 9 +-- .../tool/tractography/track_scalar_file.h | 9 +-- .../mrview/tool/tractography/tractogram.cpp | 9 +-- src/gui/mrview/tool/tractography/tractogram.h | 9 +-- .../tool/tractography/tractogram_enums.h | 9 +-- .../mrview/tool/tractography/tractography.cpp | 9 +-- .../mrview/tool/tractography/tractography.h | 9 +-- src/gui/mrview/tool/view.cpp | 9 +-- src/gui/mrview/tool/view.h | 9 +-- src/gui/mrview/volume.cpp | 9 +-- src/gui/mrview/volume.h | 9 +-- src/gui/mrview/window.cpp | 9 +-- src/gui/mrview/window.h | 9 +-- src/gui/opengl/font.cpp | 9 +-- src/gui/opengl/font.h | 9 +-- src/gui/opengl/gl.cpp | 9 +-- src/gui/opengl/gl.h | 9 +-- src/gui/opengl/gl_core_3_3.cpp | 9 +-- src/gui/opengl/gl_core_3_3.h | 9 +-- src/gui/opengl/lighting.cpp | 9 +-- src/gui/opengl/lighting.h | 9 +-- src/gui/opengl/shader.cpp | 9 +-- src/gui/opengl/shader.h | 9 +-- src/gui/opengl/transformation.h | 9 +-- src/gui/projection.cpp | 9 +-- src/gui/projection.h | 9 +-- src/gui/shapes/cube.cpp | 9 +-- src/gui/shapes/cube.h | 9 +-- src/gui/shapes/cylinder.cpp | 9 +-- src/gui/shapes/cylinder.h | 9 +-- src/gui/shapes/halfsphere.cpp | 9 +-- src/gui/shapes/halfsphere.h | 9 +-- src/gui/shapes/sphere.cpp | 9 +-- src/gui/shapes/sphere.h | 9 +-- src/gui/shview/icons.h | 9 +-- src/gui/shview/render_window.cpp | 9 +-- src/gui/shview/render_window.h | 9 +-- src/min_mem_array.h | 9 +-- src/project_version.h | 9 +-- src/registration/linear.cpp | 9 +-- src/registration/linear.h | 9 +-- src/registration/metric/cross_correlation.h | 9 +-- src/registration/metric/demons.h | 9 +-- src/registration/metric/demons4D.h | 9 +-- src/registration/metric/difference_robust.h | 9 +-- src/registration/metric/evaluate.h | 9 +-- src/registration/metric/mean_squared.h | 9 +-- .../metric/normalised_cross_correlation.h | 9 +-- src/registration/metric/params.h | 9 +-- src/registration/metric/robust_estimators.h | 9 +-- src/registration/metric/thread_kernel.h | 9 +-- src/registration/multi_resolution_lmax.h | 9 +-- src/registration/nonlinear.cpp | 9 +-- src/registration/nonlinear.h | 9 +-- src/registration/transform/affine.cpp | 9 +-- src/registration/transform/affine.h | 9 +-- src/registration/transform/base.h | 9 +-- .../transform/convergence_check.cpp | 9 +-- .../transform/convergence_check.h | 9 +-- src/registration/transform/initialiser.cpp | 9 +-- src/registration/transform/initialiser.h | 9 +-- .../transform/initialiser_helpers.cpp | 9 +-- .../transform/initialiser_helpers.h | 9 +-- src/registration/transform/reorient.h | 9 +-- src/registration/transform/rigid.cpp | 9 +-- src/registration/transform/rigid.h | 9 +-- src/registration/transform/search.h | 9 +-- src/registration/warp/compose.h | 9 +-- src/registration/warp/convert.h | 9 +-- src/registration/warp/helpers.h | 9 +-- src/registration/warp/invert.h | 9 +-- src/stats/cfe.cpp | 9 +-- src/stats/cfe.h | 9 +-- src/stats/cluster.cpp | 9 +-- src/stats/cluster.h | 9 +-- src/stats/enhance.h | 9 +-- src/stats/permstack.cpp | 9 +-- src/stats/permstack.h | 9 +-- src/stats/permtest.cpp | 9 +-- src/stats/permtest.h | 9 +-- src/stats/tfce.cpp | 9 +-- src/stats/tfce.h | 9 +-- src/surface/algo/image2mesh.h | 9 +-- src/surface/algo/mesh2image.cpp | 9 +-- src/surface/algo/mesh2image.h | 9 +-- src/surface/filter/base.cpp | 9 +-- src/surface/filter/base.h | 9 +-- src/surface/filter/smooth.cpp | 9 +-- src/surface/filter/smooth.h | 9 +-- src/surface/filter/vertex_transform.cpp | 9 +-- src/surface/filter/vertex_transform.h | 9 +-- src/surface/freesurfer.cpp | 9 +-- src/surface/freesurfer.h | 9 +-- src/surface/mesh.cpp | 9 +-- src/surface/mesh.h | 9 +-- src/surface/mesh_multi.cpp | 9 +-- src/surface/mesh_multi.h | 9 +-- src/surface/polygon.cpp | 9 +-- src/surface/polygon.h | 9 +-- src/surface/scalar.cpp | 9 +-- src/surface/scalar.h | 9 +-- src/surface/types.h | 9 +-- src/surface/utils.h | 9 +-- src/wrap_r.h | 9 +-- testing/cmd/testing_diff_dir.cpp | 9 +-- testing/cmd/testing_diff_fixel.cpp | 9 +-- testing/cmd/testing_diff_fixel_old.cpp | 9 +-- testing/cmd/testing_diff_image.cpp | 9 +-- testing/cmd/testing_diff_matrix.cpp | 9 +-- testing/cmd/testing_diff_mesh.cpp | 9 +-- testing/cmd/testing_diff_peaks.cpp | 9 +-- testing/cmd/testing_diff_tck.cpp | 9 +-- testing/cmd/testing_diff_tsf.cpp | 9 +-- testing/cmd/testing_gen_data.cpp | 9 +-- testing/src/diff_images.h | 9 +-- 844 files changed, 4145 insertions(+), 3412 deletions(-) diff --git a/cmd/5tt2gmwmi.cpp b/cmd/5tt2gmwmi.cpp index 53127ea6a2..e9c4883579 100644 --- a/cmd/5tt2gmwmi.cpp +++ b/cmd/5tt2gmwmi.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/5tt2vis.cpp b/cmd/5tt2vis.cpp index 14f0ad5723..4c652a966c 100644 --- a/cmd/5tt2vis.cpp +++ b/cmd/5tt2vis.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/5ttcheck.cpp b/cmd/5ttcheck.cpp index 530abb82b5..89280bf98f 100644 --- a/cmd/5ttcheck.cpp +++ b/cmd/5ttcheck.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/5ttedit.cpp b/cmd/5ttedit.cpp index eceef43205..249d2a0685 100644 --- a/cmd/5ttedit.cpp +++ b/cmd/5ttedit.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/afdconnectivity.cpp b/cmd/afdconnectivity.cpp index 5fa0436f33..47c5ba479d 100644 --- a/cmd/afdconnectivity.cpp +++ b/cmd/afdconnectivity.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/amp2response.cpp b/cmd/amp2response.cpp index 32f3deca7d..40940dda58 100644 --- a/cmd/amp2response.cpp +++ b/cmd/amp2response.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/amp2sh.cpp b/cmd/amp2sh.cpp index 1f1f29918d..5f89dea612 100644 --- a/cmd/amp2sh.cpp +++ b/cmd/amp2sh.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/connectome2tck.cpp b/cmd/connectome2tck.cpp index 655e725573..39d66a3199 100644 --- a/cmd/connectome2tck.cpp +++ b/cmd/connectome2tck.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/connectomestats.cpp b/cmd/connectomestats.cpp index f3bc064525..4117487d8e 100644 --- a/cmd/connectomestats.cpp +++ b/cmd/connectomestats.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/dcmedit.cpp b/cmd/dcmedit.cpp index 77679f3161..63d8b028c9 100644 --- a/cmd/dcmedit.cpp +++ b/cmd/dcmedit.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/dcminfo.cpp b/cmd/dcminfo.cpp index 0ac2ae7bc6..f401263d38 100644 --- a/cmd/dcminfo.cpp +++ b/cmd/dcminfo.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/dirflip.cpp b/cmd/dirflip.cpp index a0508d57d0..b8c9ccf649 100644 --- a/cmd/dirflip.cpp +++ b/cmd/dirflip.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/dirgen.cpp b/cmd/dirgen.cpp index 88d69e0e32..ec0a69774d 100644 --- a/cmd/dirgen.cpp +++ b/cmd/dirgen.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/dirmerge.cpp b/cmd/dirmerge.cpp index e65379bc4b..78f3b558e1 100644 --- a/cmd/dirmerge.cpp +++ b/cmd/dirmerge.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/dirorder.cpp b/cmd/dirorder.cpp index 2112c46226..368b4e2522 100644 --- a/cmd/dirorder.cpp +++ b/cmd/dirorder.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/dirsplit.cpp b/cmd/dirsplit.cpp index 64c86b90ee..40c17d27ec 100644 --- a/cmd/dirsplit.cpp +++ b/cmd/dirsplit.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/dirstat.cpp b/cmd/dirstat.cpp index 52bdeb0386..2ed9d388e5 100644 --- a/cmd/dirstat.cpp +++ b/cmd/dirstat.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/dwi2adc.cpp b/cmd/dwi2adc.cpp index 3b76ed1c0c..1c8976f9cb 100644 --- a/cmd/dwi2adc.cpp +++ b/cmd/dwi2adc.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/dwi2fod.cpp b/cmd/dwi2fod.cpp index 0d77188d84..fbb254c874 100644 --- a/cmd/dwi2fod.cpp +++ b/cmd/dwi2fod.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/dwi2mask.cpp b/cmd/dwi2mask.cpp index 9b1e146d29..1dac27690a 100644 --- a/cmd/dwi2mask.cpp +++ b/cmd/dwi2mask.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/dwi2tensor.cpp b/cmd/dwi2tensor.cpp index 717b214e54..4746503d86 100644 --- a/cmd/dwi2tensor.cpp +++ b/cmd/dwi2tensor.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/dwidenoise.cpp b/cmd/dwidenoise.cpp index c18fd50ee5..a94c96f400 100644 --- a/cmd/dwidenoise.cpp +++ b/cmd/dwidenoise.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/dwiextract.cpp b/cmd/dwiextract.cpp index 5f74eb802c..f4d0e71b1c 100644 --- a/cmd/dwiextract.cpp +++ b/cmd/dwiextract.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/dwinormalise.cpp b/cmd/dwinormalise.cpp index 86e0ba14d5..f22f54adbd 100644 --- a/cmd/dwinormalise.cpp +++ b/cmd/dwinormalise.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/fixel2sh.cpp b/cmd/fixel2sh.cpp index d092c46ff4..7f950aeca2 100644 --- a/cmd/fixel2sh.cpp +++ b/cmd/fixel2sh.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/fixel2tsf.cpp b/cmd/fixel2tsf.cpp index 0c25de23ce..321c0fb5db 100644 --- a/cmd/fixel2tsf.cpp +++ b/cmd/fixel2tsf.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/fixel2voxel.cpp b/cmd/fixel2voxel.cpp index db080226ab..4cea118846 100644 --- a/cmd/fixel2voxel.cpp +++ b/cmd/fixel2voxel.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/fixelcfestats.cpp b/cmd/fixelcfestats.cpp index 07309a2e6d..b91801bf47 100644 --- a/cmd/fixelcfestats.cpp +++ b/cmd/fixelcfestats.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/fixelconvert.cpp b/cmd/fixelconvert.cpp index 2d6ff2e7a8..8221b67743 100644 --- a/cmd/fixelconvert.cpp +++ b/cmd/fixelconvert.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/fixelcorrespondence.cpp b/cmd/fixelcorrespondence.cpp index 5a3a78540a..9edc4c9ad5 100644 --- a/cmd/fixelcorrespondence.cpp +++ b/cmd/fixelcorrespondence.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/fixelcrop.cpp b/cmd/fixelcrop.cpp index a54b40b0b0..92a524fd26 100644 --- a/cmd/fixelcrop.cpp +++ b/cmd/fixelcrop.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/fixelreorient.cpp b/cmd/fixelreorient.cpp index 73a21628ed..38bd65124a 100644 --- a/cmd/fixelreorient.cpp +++ b/cmd/fixelreorient.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/fod2dec.cpp b/cmd/fod2dec.cpp index 37dd514100..a5286b56bf 100644 --- a/cmd/fod2dec.cpp +++ b/cmd/fod2dec.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/fod2fixel.cpp b/cmd/fod2fixel.cpp index e8e911874a..f68a2fc8bb 100644 --- a/cmd/fod2fixel.cpp +++ b/cmd/fod2fixel.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/label2colour.cpp b/cmd/label2colour.cpp index 4f9cde6033..74be0e40af 100644 --- a/cmd/label2colour.cpp +++ b/cmd/label2colour.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/label2mesh.cpp b/cmd/label2mesh.cpp index f7dccc0ed1..b2ee669f5f 100644 --- a/cmd/label2mesh.cpp +++ b/cmd/label2mesh.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/labelconvert.cpp b/cmd/labelconvert.cpp index 796d4416cb..ea2b0e8d67 100644 --- a/cmd/labelconvert.cpp +++ b/cmd/labelconvert.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/maskdump.cpp b/cmd/maskdump.cpp index 6b7c4231cd..9adaf6a2ec 100644 --- a/cmd/maskdump.cpp +++ b/cmd/maskdump.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/maskfilter.cpp b/cmd/maskfilter.cpp index ef6592f829..060c5f2aa9 100644 --- a/cmd/maskfilter.cpp +++ b/cmd/maskfilter.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mesh2voxel.cpp b/cmd/mesh2voxel.cpp index 2b62552f3c..273057c7ac 100644 --- a/cmd/mesh2voxel.cpp +++ b/cmd/mesh2voxel.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/meshconvert.cpp b/cmd/meshconvert.cpp index c5e412c61b..76b3a30c50 100644 --- a/cmd/meshconvert.cpp +++ b/cmd/meshconvert.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/meshfilter.cpp b/cmd/meshfilter.cpp index 477f424d90..d0f6f18a65 100644 --- a/cmd/meshfilter.cpp +++ b/cmd/meshfilter.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mraverageheader.cpp b/cmd/mraverageheader.cpp index 8f0630eb76..aadae11321 100644 --- a/cmd/mraverageheader.cpp +++ b/cmd/mraverageheader.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrcalc.cpp b/cmd/mrcalc.cpp index b7b5136583..4c94517ec3 100644 --- a/cmd/mrcalc.cpp +++ b/cmd/mrcalc.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrcat.cpp b/cmd/mrcat.cpp index d718076df0..68a51ad6a5 100644 --- a/cmd/mrcat.cpp +++ b/cmd/mrcat.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrcheckerboardmask.cpp b/cmd/mrcheckerboardmask.cpp index d01a2d06a5..c990da0c39 100644 --- a/cmd/mrcheckerboardmask.cpp +++ b/cmd/mrcheckerboardmask.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrclusterstats.cpp b/cmd/mrclusterstats.cpp index 9e29a68935..4664e05790 100644 --- a/cmd/mrclusterstats.cpp +++ b/cmd/mrclusterstats.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrconvert.cpp b/cmd/mrconvert.cpp index 80f49bc0f9..2ebc65250e 100644 --- a/cmd/mrconvert.cpp +++ b/cmd/mrconvert.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrcrop.cpp b/cmd/mrcrop.cpp index 64f7d28a07..483fc23496 100644 --- a/cmd/mrcrop.cpp +++ b/cmd/mrcrop.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrdegibbs.cpp b/cmd/mrdegibbs.cpp index 0326b206dc..94075a9a4c 100644 --- a/cmd/mrdegibbs.cpp +++ b/cmd/mrdegibbs.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrdump.cpp b/cmd/mrdump.cpp index 0d39703229..add0700bbb 100644 --- a/cmd/mrdump.cpp +++ b/cmd/mrdump.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mredit.cpp b/cmd/mredit.cpp index 471535e19e..0b90b0d385 100644 --- a/cmd/mredit.cpp +++ b/cmd/mredit.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrfilter.cpp b/cmd/mrfilter.cpp index 0ac8e201dc..76c37ea6a1 100644 --- a/cmd/mrfilter.cpp +++ b/cmd/mrfilter.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrhistmatch.cpp b/cmd/mrhistmatch.cpp index 3b49588ec6..07fa773e64 100644 --- a/cmd/mrhistmatch.cpp +++ b/cmd/mrhistmatch.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrhistogram.cpp b/cmd/mrhistogram.cpp index 8a1e9a5c24..18f9da4a44 100644 --- a/cmd/mrhistogram.cpp +++ b/cmd/mrhistogram.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrinfo.cpp b/cmd/mrinfo.cpp index e51995b792..32d1861016 100644 --- a/cmd/mrinfo.cpp +++ b/cmd/mrinfo.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrmath.cpp b/cmd/mrmath.cpp index 5a32ea6e1c..1593f7f606 100644 --- a/cmd/mrmath.cpp +++ b/cmd/mrmath.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrmesh.cpp b/cmd/mrmesh.cpp index 15225924c5..1932114453 100644 --- a/cmd/mrmesh.cpp +++ b/cmd/mrmesh.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrmetric.cpp b/cmd/mrmetric.cpp index 3bfd2cd935..c423a3e85b 100644 --- a/cmd/mrmetric.cpp +++ b/cmd/mrmetric.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrpad.cpp b/cmd/mrpad.cpp index 075af2c3dd..eea75a5816 100644 --- a/cmd/mrpad.cpp +++ b/cmd/mrpad.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrregister.cpp b/cmd/mrregister.cpp index dee64e8f8a..e0903d9b34 100644 --- a/cmd/mrregister.cpp +++ b/cmd/mrregister.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrresize.cpp b/cmd/mrresize.cpp index bbecdcea7a..9ce3e313de 100644 --- a/cmd/mrresize.cpp +++ b/cmd/mrresize.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrstats.cpp b/cmd/mrstats.cpp index 1f8b948cc4..514cbfc59e 100644 --- a/cmd/mrstats.cpp +++ b/cmd/mrstats.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrthreshold.cpp b/cmd/mrthreshold.cpp index 54a940d1d5..ea73158c17 100644 --- a/cmd/mrthreshold.cpp +++ b/cmd/mrthreshold.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrtransform.cpp b/cmd/mrtransform.cpp index 4bb7f1fdd6..ddc3508368 100644 --- a/cmd/mrtransform.cpp +++ b/cmd/mrtransform.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mrview.cpp b/cmd/mrview.cpp index 9aa3668d8d..114ad888b3 100644 --- a/cmd/mrview.cpp +++ b/cmd/mrview.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/mtnormalise.cpp b/cmd/mtnormalise.cpp index d36adf1520..9f64d833bc 100644 --- a/cmd/mtnormalise.cpp +++ b/cmd/mtnormalise.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/peaks2amp.cpp b/cmd/peaks2amp.cpp index 163d7100bc..1dd5bfb3b4 100644 --- a/cmd/peaks2amp.cpp +++ b/cmd/peaks2amp.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/sh2amp.cpp b/cmd/sh2amp.cpp index 19b617636f..ac404828a8 100644 --- a/cmd/sh2amp.cpp +++ b/cmd/sh2amp.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/sh2peaks.cpp b/cmd/sh2peaks.cpp index ed9cb614f4..05539647f5 100644 --- a/cmd/sh2peaks.cpp +++ b/cmd/sh2peaks.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/sh2power.cpp b/cmd/sh2power.cpp index 5b0c189808..ec6b0e409d 100644 --- a/cmd/sh2power.cpp +++ b/cmd/sh2power.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/sh2response.cpp b/cmd/sh2response.cpp index 1e1688813e..44649dbcc3 100644 --- a/cmd/sh2response.cpp +++ b/cmd/sh2response.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/shbasis.cpp b/cmd/shbasis.cpp index a622edf181..ab8432f7e7 100644 --- a/cmd/shbasis.cpp +++ b/cmd/shbasis.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/shconv.cpp b/cmd/shconv.cpp index 396db4168c..f0d6bfba96 100644 --- a/cmd/shconv.cpp +++ b/cmd/shconv.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/shview.cpp b/cmd/shview.cpp index 0adbc1cfa9..f66d6a6a25 100644 --- a/cmd/shview.cpp +++ b/cmd/shview.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tck2connectome.cpp b/cmd/tck2connectome.cpp index 900137b5d6..2781e86749 100644 --- a/cmd/tck2connectome.cpp +++ b/cmd/tck2connectome.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tck2fixel.cpp b/cmd/tck2fixel.cpp index bcdbbfe47c..7d7ce1a2bc 100644 --- a/cmd/tck2fixel.cpp +++ b/cmd/tck2fixel.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tckconvert.cpp b/cmd/tckconvert.cpp index 685598a09f..318ffb7de2 100644 --- a/cmd/tckconvert.cpp +++ b/cmd/tckconvert.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tckdfc.cpp b/cmd/tckdfc.cpp index dd92088238..db20ebae8f 100644 --- a/cmd/tckdfc.cpp +++ b/cmd/tckdfc.cpp @@ -1,16 +1,18 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ + #include "command.h" #include "exception.h" #include "header.h" diff --git a/cmd/tckedit.cpp b/cmd/tckedit.cpp index 664dcdcc51..37ada0e6f8 100644 --- a/cmd/tckedit.cpp +++ b/cmd/tckedit.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tckgen.cpp b/cmd/tckgen.cpp index 80fe9ec9e2..38f03c6bee 100644 --- a/cmd/tckgen.cpp +++ b/cmd/tckgen.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tckglobal.cpp b/cmd/tckglobal.cpp index fad61c9113..2a010bf518 100644 --- a/cmd/tckglobal.cpp +++ b/cmd/tckglobal.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tckinfo.cpp b/cmd/tckinfo.cpp index b3e734ca66..1c14e0ef17 100644 --- a/cmd/tckinfo.cpp +++ b/cmd/tckinfo.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tckmap.cpp b/cmd/tckmap.cpp index 556c81c609..53dfac6a46 100644 --- a/cmd/tckmap.cpp +++ b/cmd/tckmap.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tckresample.cpp b/cmd/tckresample.cpp index 4c701b8141..c9731e9adb 100644 --- a/cmd/tckresample.cpp +++ b/cmd/tckresample.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tcksample.cpp b/cmd/tcksample.cpp index e443d7aba5..87dbaabed7 100644 --- a/cmd/tcksample.cpp +++ b/cmd/tcksample.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tcksift.cpp b/cmd/tcksift.cpp index ab625897eb..6f6b2725ea 100644 --- a/cmd/tcksift.cpp +++ b/cmd/tcksift.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tcksift2.cpp b/cmd/tcksift2.cpp index 935a9ce800..54aa80b00b 100644 --- a/cmd/tcksift2.cpp +++ b/cmd/tcksift2.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tckstats.cpp b/cmd/tckstats.cpp index 89d69c0c73..926cbf4b67 100644 --- a/cmd/tckstats.cpp +++ b/cmd/tckstats.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tcktransform.cpp b/cmd/tcktransform.cpp index 6913378aae..9905ad6eca 100644 --- a/cmd/tcktransform.cpp +++ b/cmd/tcktransform.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tensor2metric.cpp b/cmd/tensor2metric.cpp index c007aed420..140d58f5af 100644 --- a/cmd/tensor2metric.cpp +++ b/cmd/tensor2metric.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/transformcalc.cpp b/cmd/transformcalc.cpp index 26ad8a7eb6..ae1288acf7 100644 --- a/cmd/transformcalc.cpp +++ b/cmd/transformcalc.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/transformcompose.cpp b/cmd/transformcompose.cpp index e4696ee8cc..66e3224d1c 100644 --- a/cmd/transformcompose.cpp +++ b/cmd/transformcompose.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/transformconvert.cpp b/cmd/transformconvert.cpp index 40488a23fb..fdf1a33ef3 100644 --- a/cmd/transformconvert.cpp +++ b/cmd/transformconvert.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tsfdivide.cpp b/cmd/tsfdivide.cpp index c2700864d1..48879af593 100644 --- a/cmd/tsfdivide.cpp +++ b/cmd/tsfdivide.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tsfinfo.cpp b/cmd/tsfinfo.cpp index 920f24d6ad..8dea149f81 100644 --- a/cmd/tsfinfo.cpp +++ b/cmd/tsfinfo.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tsfmult.cpp b/cmd/tsfmult.cpp index 76e9fb1fd1..90d8ac6882 100644 --- a/cmd/tsfmult.cpp +++ b/cmd/tsfmult.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tsfsmooth.cpp b/cmd/tsfsmooth.cpp index 56f2fa89a6..211ed0d45a 100644 --- a/cmd/tsfsmooth.cpp +++ b/cmd/tsfsmooth.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/tsfthreshold.cpp b/cmd/tsfthreshold.cpp index b92eba0a21..d36464bd9c 100644 --- a/cmd/tsfthreshold.cpp +++ b/cmd/tsfthreshold.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/vectorstats.cpp b/cmd/vectorstats.cpp index 4eaea1d94f..c7ac0ca24c 100644 --- a/cmd/vectorstats.cpp +++ b/cmd/vectorstats.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/voxel2fixel.cpp b/cmd/voxel2fixel.cpp index 0b52551969..60697977b8 100644 --- a/cmd/voxel2fixel.cpp +++ b/cmd/voxel2fixel.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/warp2metric.cpp b/cmd/warp2metric.cpp index 114eeaf023..cf6d03a30b 100644 --- a/cmd/warp2metric.cpp +++ b/cmd/warp2metric.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/warpconvert.cpp b/cmd/warpconvert.cpp index 84530f7426..aa77e01094 100644 --- a/cmd/warpconvert.cpp +++ b/cmd/warpconvert.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/warpcorrect.cpp b/cmd/warpcorrect.cpp index 5e12f31ce0..9295001b69 100644 --- a/cmd/warpcorrect.cpp +++ b/cmd/warpcorrect.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/warpinit.cpp b/cmd/warpinit.cpp index b716afb444..89d8fb551f 100644 --- a/cmd/warpinit.cpp +++ b/cmd/warpinit.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/cmd/warpinvert.cpp b/cmd/warpinvert.cpp index 0d59ab5b70..26a91b1e33 100644 --- a/cmd/warpinvert.cpp +++ b/cmd/warpinvert.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/adapter/base.h b/core/adapter/base.h index d7d713aa60..df5443663c 100644 --- a/core/adapter/base.h +++ b/core/adapter/base.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/adapter/extract.h b/core/adapter/extract.h index 53922db8fe..0bcdaca2fd 100644 --- a/core/adapter/extract.h +++ b/core/adapter/extract.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/adapter/gaussian1D.h b/core/adapter/gaussian1D.h index 560117def9..697736b57f 100644 --- a/core/adapter/gaussian1D.h +++ b/core/adapter/gaussian1D.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/adapter/gradient1D.h b/core/adapter/gradient1D.h index 5c23c855a2..f756d1a717 100644 --- a/core/adapter/gradient1D.h +++ b/core/adapter/gradient1D.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/adapter/gradient3D.h b/core/adapter/gradient3D.h index b10229c076..fd8ef4720e 100644 --- a/core/adapter/gradient3D.h +++ b/core/adapter/gradient3D.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/adapter/jacobian.h b/core/adapter/jacobian.h index aaa2b9c353..faa883a36c 100644 --- a/core/adapter/jacobian.h +++ b/core/adapter/jacobian.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/adapter/median.h b/core/adapter/median.h index 6c22fdd050..1963e1f348 100644 --- a/core/adapter/median.h +++ b/core/adapter/median.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/adapter/neighbourhood3D.h b/core/adapter/neighbourhood3D.h index 3cc76807ad..98551a8632 100644 --- a/core/adapter/neighbourhood3D.h +++ b/core/adapter/neighbourhood3D.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/adapter/normalise3D.h b/core/adapter/normalise3D.h index 8b6b38292b..be35da448b 100644 --- a/core/adapter/normalise3D.h +++ b/core/adapter/normalise3D.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/adapter/permute_axes.h b/core/adapter/permute_axes.h index c2be8f5c1f..6a8e05e27d 100644 --- a/core/adapter/permute_axes.h +++ b/core/adapter/permute_axes.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/adapter/replicate.h b/core/adapter/replicate.h index 7c2873f122..ec6d9c4855 100644 --- a/core/adapter/replicate.h +++ b/core/adapter/replicate.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/adapter/reslice.cpp b/core/adapter/reslice.cpp index a4dd888ac5..2f4a80ee2c 100644 --- a/core/adapter/reslice.cpp +++ b/core/adapter/reslice.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/adapter/reslice.h b/core/adapter/reslice.h index 273fab7d27..282762cebc 100644 --- a/core/adapter/reslice.h +++ b/core/adapter/reslice.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/adapter/subset.h b/core/adapter/subset.h index 23ec1e41f3..d0a79d47bc 100644 --- a/core/adapter/subset.h +++ b/core/adapter/subset.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/adapter/warp.h b/core/adapter/warp.h index d3f91cf7fc..7965c2aed4 100644 --- a/core/adapter/warp.h +++ b/core/adapter/warp.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/algo/copy.h b/core/algo/copy.h index 8357323a18..a0d16f2d5e 100644 --- a/core/algo/copy.h +++ b/core/algo/copy.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/algo/histogram.cpp b/core/algo/histogram.cpp index a12a493155..8dfd180dc9 100644 --- a/core/algo/histogram.cpp +++ b/core/algo/histogram.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/algo/histogram.h b/core/algo/histogram.h index f1c6f0ebd5..da946b932f 100644 --- a/core/algo/histogram.h +++ b/core/algo/histogram.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/algo/iterator.h b/core/algo/iterator.h index 9bcb62d8f8..1f541a222b 100644 --- a/core/algo/iterator.h +++ b/core/algo/iterator.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/algo/loop.h b/core/algo/loop.h index e348c0778d..55cf6d7da2 100644 --- a/core/algo/loop.h +++ b/core/algo/loop.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/algo/min_max.h b/core/algo/min_max.h index 8a2a6353f9..f537f479a0 100644 --- a/core/algo/min_max.h +++ b/core/algo/min_max.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/algo/neighbourhooditerator.h b/core/algo/neighbourhooditerator.h index 0e96d2897a..da884ae937 100644 --- a/core/algo/neighbourhooditerator.h +++ b/core/algo/neighbourhooditerator.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/algo/random_loop.h b/core/algo/random_loop.h index db8dbc827f..01bb2821c9 100644 --- a/core/algo/random_loop.h +++ b/core/algo/random_loop.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/algo/random_threaded_loop.h b/core/algo/random_threaded_loop.h index bc49627b7b..21169c2be4 100644 --- a/core/algo/random_threaded_loop.h +++ b/core/algo/random_threaded_loop.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/algo/stochastic_threaded_loop.h b/core/algo/stochastic_threaded_loop.h index b3b991c568..ecbce9edb2 100644 --- a/core/algo/stochastic_threaded_loop.h +++ b/core/algo/stochastic_threaded_loop.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/algo/threaded_copy.h b/core/algo/threaded_copy.h index 6670cffcad..eea448b0b3 100644 --- a/core/algo/threaded_copy.h +++ b/core/algo/threaded_copy.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/algo/threaded_loop.h b/core/algo/threaded_loop.h index bddacf0a79..afcb85452d 100644 --- a/core/algo/threaded_loop.h +++ b/core/algo/threaded_loop.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/app.cpp b/core/app.cpp index b0ea2d4460..8ccd2df111 100644 --- a/core/app.cpp +++ b/core/app.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ @@ -56,17 +57,17 @@ namespace MR const char* AUTHOR = nullptr; const char* COPYRIGHT = - "Copyright (c) 2008-2017 the MRtrix3 contributors." + "Copyright (c) 2008-2018 the MRtrix3 contributors." "\n\n" "This Source Code Form is subject to the terms of the Mozilla Public\n" "License, v. 2.0. If a copy of the MPL was not distributed with this\n" - "file, you can obtain one at http://mozilla.org/MPL/2.0/.\n" + "file, you can obtain one at http://mozilla.org/MPL/2.0/\n" "\n" - "MRtrix is distributed in the hope that it will be useful,\n" + "MRtrix3 is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty\n" "of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" "\n" - "For more details, see http://www.mrtrix.org/.\n"; + "For more details, see http://www.mrtrix.org/\n"; const char* SYNOPSIS = nullptr; diff --git a/core/app.h b/core/app.h index 9f8c696d47..34c872c923 100644 --- a/core/app.h +++ b/core/app.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/apply.h b/core/apply.h index 4593b394f5..995aa82347 100644 --- a/core/apply.h +++ b/core/apply.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/axes.cpp b/core/axes.cpp index 939a5616a1..26c5a80870 100644 --- a/core/axes.cpp +++ b/core/axes.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/axes.h b/core/axes.h index 4081c26a62..134aa038cc 100644 --- a/core/axes.h +++ b/core/axes.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/bitset.cpp b/core/bitset.cpp index 5fb77e04e8..6b33f048e4 100644 --- a/core/bitset.cpp +++ b/core/bitset.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/bitset.h b/core/bitset.h index bfad9c0b95..3ba30c6b6c 100644 --- a/core/bitset.h +++ b/core/bitset.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/cmdline_option.h b/core/cmdline_option.h index 3579e98f3e..4cf2b62fde 100644 --- a/core/cmdline_option.h +++ b/core/cmdline_option.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/command.h b/core/command.h index 2f4e7fefe3..0182742024 100644 --- a/core/command.h +++ b/core/command.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/datatype.cpp b/core/datatype.cpp index c68964495b..ee12613adb 100644 --- a/core/datatype.cpp +++ b/core/datatype.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/datatype.h b/core/datatype.h index 7699c29543..c2343e7e90 100644 --- a/core/datatype.h +++ b/core/datatype.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/debug.h b/core/debug.h index 4bb8d6f400..d91930a8c0 100644 --- a/core/debug.h +++ b/core/debug.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/eigen_plugins/array.h b/core/eigen_plugins/array.h index 1f84778d4e..b78da4a29e 100644 --- a/core/eigen_plugins/array.h +++ b/core/eigen_plugins/array.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/eigen_plugins/dense_base.h b/core/eigen_plugins/dense_base.h index 112c03be4a..f7654bb6de 100644 --- a/core/eigen_plugins/dense_base.h +++ b/core/eigen_plugins/dense_base.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/eigen_plugins/matrix.h b/core/eigen_plugins/matrix.h index 672812f7a8..46626f986f 100644 --- a/core/eigen_plugins/matrix.h +++ b/core/eigen_plugins/matrix.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/exception.cpp b/core/exception.cpp index a8a79992f6..e2af692965 100644 --- a/core/exception.cpp +++ b/core/exception.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/exception.h b/core/exception.h index b4559de073..f407fedeba 100644 --- a/core/exception.h +++ b/core/exception.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/config.cpp b/core/file/config.cpp index 9b72b6b2ce..c908360948 100644 --- a/core/file/config.cpp +++ b/core/file/config.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/config.h b/core/file/config.h index 1020456b39..e5fb2b5d27 100644 --- a/core/file/config.h +++ b/core/file/config.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/copy.h b/core/file/copy.h index 9d50f335e5..9ba682fef1 100644 --- a/core/file/copy.h +++ b/core/file/copy.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/csa_entry.h b/core/file/dicom/csa_entry.h index 7450e06aa5..4e4653984e 100644 --- a/core/file/dicom/csa_entry.h +++ b/core/file/dicom/csa_entry.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/definitions.h b/core/file/dicom/definitions.h index 80f63ea66f..fd0a3ff074 100644 --- a/core/file/dicom/definitions.h +++ b/core/file/dicom/definitions.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/dict.cpp b/core/file/dicom/dict.cpp index 33b2eaf8f9..00c721534e 100644 --- a/core/file/dicom/dict.cpp +++ b/core/file/dicom/dict.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/element.cpp b/core/file/dicom/element.cpp index 4a889f8725..ed21308d07 100644 --- a/core/file/dicom/element.cpp +++ b/core/file/dicom/element.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/element.h b/core/file/dicom/element.h index c073bd1142..cc8c91509c 100644 --- a/core/file/dicom/element.h +++ b/core/file/dicom/element.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/image.cpp b/core/file/dicom/image.cpp index a03b3a10f4..b44c7e219b 100644 --- a/core/file/dicom/image.cpp +++ b/core/file/dicom/image.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/image.h b/core/file/dicom/image.h index 053cd312f0..608a3f9f86 100644 --- a/core/file/dicom/image.h +++ b/core/file/dicom/image.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/mapper.cpp b/core/file/dicom/mapper.cpp index 362ce9be03..a2f4fce689 100644 --- a/core/file/dicom/mapper.cpp +++ b/core/file/dicom/mapper.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/mapper.h b/core/file/dicom/mapper.h index 617cff2e78..027a2feced 100644 --- a/core/file/dicom/mapper.h +++ b/core/file/dicom/mapper.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/patient.cpp b/core/file/dicom/patient.cpp index fba7eff95c..3563dca751 100644 --- a/core/file/dicom/patient.cpp +++ b/core/file/dicom/patient.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/patient.h b/core/file/dicom/patient.h index ffdbd200c4..4d61b61daa 100644 --- a/core/file/dicom/patient.h +++ b/core/file/dicom/patient.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/quick_scan.cpp b/core/file/dicom/quick_scan.cpp index 9e5d97811a..2f98552bd4 100644 --- a/core/file/dicom/quick_scan.cpp +++ b/core/file/dicom/quick_scan.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/quick_scan.h b/core/file/dicom/quick_scan.h index 1ee8eb9e29..14ff5d1952 100644 --- a/core/file/dicom/quick_scan.h +++ b/core/file/dicom/quick_scan.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/select_cmdline.cpp b/core/file/dicom/select_cmdline.cpp index 01a4f536e5..a8ce5a034e 100644 --- a/core/file/dicom/select_cmdline.cpp +++ b/core/file/dicom/select_cmdline.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/series.cpp b/core/file/dicom/series.cpp index dc860d7ce8..ca48329d88 100644 --- a/core/file/dicom/series.cpp +++ b/core/file/dicom/series.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/series.h b/core/file/dicom/series.h index c5dca4bcdc..6dd4fdd7ce 100644 --- a/core/file/dicom/series.h +++ b/core/file/dicom/series.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/study.cpp b/core/file/dicom/study.cpp index c236026a0f..d0c6a6d69e 100644 --- a/core/file/dicom/study.cpp +++ b/core/file/dicom/study.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/study.h b/core/file/dicom/study.h index f91241c90d..49a92e0442 100644 --- a/core/file/dicom/study.h +++ b/core/file/dicom/study.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/tree.cpp b/core/file/dicom/tree.cpp index 4f7f08a2a0..b2dd54b1f5 100644 --- a/core/file/dicom/tree.cpp +++ b/core/file/dicom/tree.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/dicom/tree.h b/core/file/dicom/tree.h index 716208fa76..c96a8d5f16 100644 --- a/core/file/dicom/tree.h +++ b/core/file/dicom/tree.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/entry.h b/core/file/entry.h index c24936d1b5..5578098594 100644 --- a/core/file/entry.h +++ b/core/file/entry.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/gz.h b/core/file/gz.h index 46815a25e9..d95bc9c6d0 100644 --- a/core/file/gz.h +++ b/core/file/gz.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/json_utils.cpp b/core/file/json_utils.cpp index 3880ca53c2..64d11beaaf 100644 --- a/core/file/json_utils.cpp +++ b/core/file/json_utils.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/json_utils.h b/core/file/json_utils.h index 25969998d5..8674af5825 100644 --- a/core/file/json_utils.h +++ b/core/file/json_utils.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/key_value.cpp b/core/file/key_value.cpp index e91322bb46..eabd9fbac9 100644 --- a/core/file/key_value.cpp +++ b/core/file/key_value.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/key_value.h b/core/file/key_value.h index 8acbf4ba83..6a7f17ac6a 100644 --- a/core/file/key_value.h +++ b/core/file/key_value.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/mgh.cpp b/core/file/mgh.cpp index 55d0ce4d3a..f7d43027b9 100644 --- a/core/file/mgh.cpp +++ b/core/file/mgh.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/mgh.h b/core/file/mgh.h index 1305611db1..b34b4657f5 100644 --- a/core/file/mgh.h +++ b/core/file/mgh.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/mmap.cpp b/core/file/mmap.cpp index fbf5efc542..87cecbd2d5 100644 --- a/core/file/mmap.cpp +++ b/core/file/mmap.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/mmap.h b/core/file/mmap.h index 089a0d7187..4a242d765d 100644 --- a/core/file/mmap.h +++ b/core/file/mmap.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/name_parser.cpp b/core/file/name_parser.cpp index d3a4017ba1..bdea3e6d41 100644 --- a/core/file/name_parser.cpp +++ b/core/file/name_parser.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/name_parser.h b/core/file/name_parser.h index 07537cb8cf..d35a827c83 100644 --- a/core/file/name_parser.h +++ b/core/file/name_parser.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/nifti1_utils.cpp b/core/file/nifti1_utils.cpp index 59b2a04ce4..92ad226073 100644 --- a/core/file/nifti1_utils.cpp +++ b/core/file/nifti1_utils.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/nifti1_utils.h b/core/file/nifti1_utils.h index 16b117eaab..f7c19250ce 100644 --- a/core/file/nifti1_utils.h +++ b/core/file/nifti1_utils.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/nifti2.h b/core/file/nifti2.h index 5643fa909e..661f52a7d4 100644 --- a/core/file/nifti2.h +++ b/core/file/nifti2.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/nifti2_utils.cpp b/core/file/nifti2_utils.cpp index 9d1c987288..4119222878 100644 --- a/core/file/nifti2_utils.cpp +++ b/core/file/nifti2_utils.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/nifti2_utils.h b/core/file/nifti2_utils.h index 39f272b8f4..2af5f05cbf 100644 --- a/core/file/nifti2_utils.h +++ b/core/file/nifti2_utils.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/nifti_utils.cpp b/core/file/nifti_utils.cpp index fa819b19aa..be277a47d4 100644 --- a/core/file/nifti_utils.cpp +++ b/core/file/nifti_utils.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/nifti_utils.h b/core/file/nifti_utils.h index b5b2d93985..91eb7e9d10 100644 --- a/core/file/nifti_utils.h +++ b/core/file/nifti_utils.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/ofstream.cpp b/core/file/ofstream.cpp index 90cf2a1269..5486e3fd7f 100644 --- a/core/file/ofstream.cpp +++ b/core/file/ofstream.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/ofstream.h b/core/file/ofstream.h index cfbd8f4fdc..4eab3940d3 100644 --- a/core/file/ofstream.h +++ b/core/file/ofstream.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/path.h b/core/file/path.h index b2beaa09f0..cd62ecdb64 100644 --- a/core/file/path.h +++ b/core/file/path.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/tiff.cpp b/core/file/tiff.cpp index e0774271cb..35ad69c5e8 100644 --- a/core/file/tiff.cpp +++ b/core/file/tiff.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/tiff.h b/core/file/tiff.h index e95bdca821..b36ff23574 100644 --- a/core/file/tiff.h +++ b/core/file/tiff.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/file/utils.h b/core/file/utils.h index 563a4a64e3..8c8e0b758e 100644 --- a/core/file/utils.h +++ b/core/file/utils.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/filter/base.h b/core/filter/base.h index b61078ee9c..542163822c 100644 --- a/core/filter/base.h +++ b/core/filter/base.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/filter/connected_components.h b/core/filter/connected_components.h index 8f8bd5ed52..f642109171 100644 --- a/core/filter/connected_components.h +++ b/core/filter/connected_components.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/filter/dilate.h b/core/filter/dilate.h index fb3ddf5b67..32f6291fb0 100644 --- a/core/filter/dilate.h +++ b/core/filter/dilate.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/filter/dwi_brain_mask.h b/core/filter/dwi_brain_mask.h index 7078706cdd..b7364a7b6d 100644 --- a/core/filter/dwi_brain_mask.h +++ b/core/filter/dwi_brain_mask.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/filter/erode.h b/core/filter/erode.h index bca8051c9e..a41a2d3cba 100644 --- a/core/filter/erode.h +++ b/core/filter/erode.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/filter/fft.h b/core/filter/fft.h index c8a4e24e17..ec8072f753 100644 --- a/core/filter/fft.h +++ b/core/filter/fft.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/filter/gradient.h b/core/filter/gradient.h index 511e8ece97..4c04d16e4b 100644 --- a/core/filter/gradient.h +++ b/core/filter/gradient.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/filter/mask_clean.h b/core/filter/mask_clean.h index 6912149ecc..c298d619f5 100644 --- a/core/filter/mask_clean.h +++ b/core/filter/mask_clean.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/filter/median.h b/core/filter/median.h index 2b99e6a51d..117d1eed1a 100644 --- a/core/filter/median.h +++ b/core/filter/median.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/filter/normalise.h b/core/filter/normalise.h index 7f5864bb3f..1b12aa01d6 100644 --- a/core/filter/normalise.h +++ b/core/filter/normalise.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/filter/optimal_threshold.h b/core/filter/optimal_threshold.h index b2bd59ce1e..03954fa9b2 100644 --- a/core/filter/optimal_threshold.h +++ b/core/filter/optimal_threshold.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/filter/resize.h b/core/filter/resize.h index e656671f01..c35aad63ba 100644 --- a/core/filter/resize.h +++ b/core/filter/resize.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/filter/reslice.h b/core/filter/reslice.h index f6fe26e971..64953f13a7 100644 --- a/core/filter/reslice.h +++ b/core/filter/reslice.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/filter/smooth.h b/core/filter/smooth.h index e54960510a..f8849e07ee 100644 --- a/core/filter/smooth.h +++ b/core/filter/smooth.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/filter/warp.h b/core/filter/warp.h index 5a51231dd2..027771a76e 100644 --- a/core/filter/warp.h +++ b/core/filter/warp.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/fixel/helpers.h b/core/fixel/helpers.h index 4c7d1eea5c..00d6fb6d63 100644 --- a/core/fixel/helpers.h +++ b/core/fixel/helpers.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/fixel/keys.h b/core/fixel/keys.h index 1c4a556ddf..0e39dd3b82 100644 --- a/core/fixel/keys.h +++ b/core/fixel/keys.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/fixel/legacy/fixel_metric.h b/core/fixel/legacy/fixel_metric.h index 6e719a7806..5b25f0bd33 100644 --- a/core/fixel/legacy/fixel_metric.h +++ b/core/fixel/legacy/fixel_metric.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/fixel/legacy/image.h b/core/fixel/legacy/image.h index 6c63cdc9fd..b6f3b2bf85 100644 --- a/core/fixel/legacy/image.h +++ b/core/fixel/legacy/image.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/fixel/legacy/keys.h b/core/fixel/legacy/keys.h index 8c61acff47..af50ca78ee 100644 --- a/core/fixel/legacy/keys.h +++ b/core/fixel/legacy/keys.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/fixel/loop.h b/core/fixel/loop.h index 84d0ee58a2..04ff777905 100644 --- a/core/fixel/loop.h +++ b/core/fixel/loop.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/analyse.cpp b/core/formats/analyse.cpp index 3bf6ed8789..cffec7db88 100644 --- a/core/formats/analyse.cpp +++ b/core/formats/analyse.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/dicom.cpp b/core/formats/dicom.cpp index ca292ce202..d21ef0379d 100644 --- a/core/formats/dicom.cpp +++ b/core/formats/dicom.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/list.cpp b/core/formats/list.cpp index a7ff9afabd..8988d2766a 100644 --- a/core/formats/list.cpp +++ b/core/formats/list.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/list.h b/core/formats/list.h index 8e5f0caa14..bc890e7e33 100644 --- a/core/formats/list.h +++ b/core/formats/list.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/mgh.cpp b/core/formats/mgh.cpp index f0c0891368..879105b6c8 100644 --- a/core/formats/mgh.cpp +++ b/core/formats/mgh.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/mgz.cpp b/core/formats/mgz.cpp index c21b7a7859..1b95216247 100644 --- a/core/formats/mgz.cpp +++ b/core/formats/mgz.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/mri.cpp b/core/formats/mri.cpp index b97900500f..8cb955da28 100644 --- a/core/formats/mri.cpp +++ b/core/formats/mri.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/mrtrix.cpp b/core/formats/mrtrix.cpp index f1bc9f35ac..186ef1ddf2 100644 --- a/core/formats/mrtrix.cpp +++ b/core/formats/mrtrix.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/mrtrix_gz.cpp b/core/formats/mrtrix_gz.cpp index 5becbb5e27..26e1f54085 100644 --- a/core/formats/mrtrix_gz.cpp +++ b/core/formats/mrtrix_gz.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/mrtrix_sparse_legacy.cpp b/core/formats/mrtrix_sparse_legacy.cpp index a71d42c5c8..e2f20b7ee2 100644 --- a/core/formats/mrtrix_sparse_legacy.cpp +++ b/core/formats/mrtrix_sparse_legacy.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/mrtrix_utils.cpp b/core/formats/mrtrix_utils.cpp index bdeb4983ca..860704f1ea 100644 --- a/core/formats/mrtrix_utils.cpp +++ b/core/formats/mrtrix_utils.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/mrtrix_utils.h b/core/formats/mrtrix_utils.h index 22c1ead8ea..354af534f1 100644 --- a/core/formats/mrtrix_utils.h +++ b/core/formats/mrtrix_utils.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/nifti1.cpp b/core/formats/nifti1.cpp index 06d4977df1..98a5ab1f2e 100644 --- a/core/formats/nifti1.cpp +++ b/core/formats/nifti1.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/nifti1_gz.cpp b/core/formats/nifti1_gz.cpp index 588f1a322e..dde7ae0dea 100644 --- a/core/formats/nifti1_gz.cpp +++ b/core/formats/nifti1_gz.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/nifti2.cpp b/core/formats/nifti2.cpp index 06c76faa18..c8f7058545 100644 --- a/core/formats/nifti2.cpp +++ b/core/formats/nifti2.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/nifti2_gz.cpp b/core/formats/nifti2_gz.cpp index b79a28145e..337530821d 100644 --- a/core/formats/nifti2_gz.cpp +++ b/core/formats/nifti2_gz.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/pipe.cpp b/core/formats/pipe.cpp index 2df7a70de8..b62577b48d 100644 --- a/core/formats/pipe.cpp +++ b/core/formats/pipe.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/ram.cpp b/core/formats/ram.cpp index cf5b201e76..ddb0d9c0f2 100644 --- a/core/formats/ram.cpp +++ b/core/formats/ram.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/tiff.cpp b/core/formats/tiff.cpp index 842bb23eb8..1a1b9de515 100644 --- a/core/formats/tiff.cpp +++ b/core/formats/tiff.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/formats/xds.cpp b/core/formats/xds.cpp index 9d2783c72d..b6fc82c105 100644 --- a/core/formats/xds.cpp +++ b/core/formats/xds.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/header.cpp b/core/header.cpp index e73eab1580..de80892fbf 100644 --- a/core/header.cpp +++ b/core/header.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/header.h b/core/header.h index cc52ae9375..ec541daae8 100644 --- a/core/header.h +++ b/core/header.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image.h b/core/image.h index 8a44acf1bf..ed2794020e 100644 --- a/core/image.h +++ b/core/image.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_diff.h b/core/image_diff.h index b3e75a6ae6..0ddc6cf440 100644 --- a/core/image_diff.h +++ b/core/image_diff.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_helpers.h b/core/image_helpers.h index dad79c5ab3..65c75fe50c 100644 --- a/core/image_helpers.h +++ b/core/image_helpers.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/base.cpp b/core/image_io/base.cpp index bd347aeee6..b85d35a760 100644 --- a/core/image_io/base.cpp +++ b/core/image_io/base.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/base.h b/core/image_io/base.h index a7d66bb30a..68be470de9 100644 --- a/core/image_io/base.h +++ b/core/image_io/base.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/default.cpp b/core/image_io/default.cpp index c2f1a09ad6..7aeffb64c1 100644 --- a/core/image_io/default.cpp +++ b/core/image_io/default.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/default.h b/core/image_io/default.h index 0b9267f477..d67cdac0be 100644 --- a/core/image_io/default.h +++ b/core/image_io/default.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/fetch_store.cpp b/core/image_io/fetch_store.cpp index b18cf5dd3e..3f62c53d5b 100644 --- a/core/image_io/fetch_store.cpp +++ b/core/image_io/fetch_store.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/fetch_store.h b/core/image_io/fetch_store.h index b7461f62a7..1776ae9967 100644 --- a/core/image_io/fetch_store.h +++ b/core/image_io/fetch_store.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/gz.cpp b/core/image_io/gz.cpp index 3b834ab1fb..b9acc9a38b 100644 --- a/core/image_io/gz.cpp +++ b/core/image_io/gz.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/gz.h b/core/image_io/gz.h index d260fff737..cd59262f36 100644 --- a/core/image_io/gz.h +++ b/core/image_io/gz.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/mosaic.cpp b/core/image_io/mosaic.cpp index 3c43f673ae..1facc941c9 100644 --- a/core/image_io/mosaic.cpp +++ b/core/image_io/mosaic.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/mosaic.h b/core/image_io/mosaic.h index 711c5f4b8a..430573c56b 100644 --- a/core/image_io/mosaic.h +++ b/core/image_io/mosaic.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/pipe.cpp b/core/image_io/pipe.cpp index eebea1ce4b..494319c807 100644 --- a/core/image_io/pipe.cpp +++ b/core/image_io/pipe.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/pipe.h b/core/image_io/pipe.h index 418fb1b57e..9a4864e49f 100644 --- a/core/image_io/pipe.h +++ b/core/image_io/pipe.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/ram.cpp b/core/image_io/ram.cpp index 42fef3fb4e..7f4005853e 100644 --- a/core/image_io/ram.cpp +++ b/core/image_io/ram.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/ram.h b/core/image_io/ram.h index fb7d891be8..bca8a43427 100644 --- a/core/image_io/ram.h +++ b/core/image_io/ram.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/scratch.cpp b/core/image_io/scratch.cpp index 04a6933f79..28a359b154 100644 --- a/core/image_io/scratch.cpp +++ b/core/image_io/scratch.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/scratch.h b/core/image_io/scratch.h index ef1a2ae489..7b02032964 100644 --- a/core/image_io/scratch.h +++ b/core/image_io/scratch.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/sparse.cpp b/core/image_io/sparse.cpp index 646f9a00b8..f3e0786abd 100644 --- a/core/image_io/sparse.cpp +++ b/core/image_io/sparse.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/sparse.h b/core/image_io/sparse.h index fad235bcab..b6798817a0 100644 --- a/core/image_io/sparse.h +++ b/core/image_io/sparse.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/tiff.cpp b/core/image_io/tiff.cpp index 8fbd6808a6..e35044d5b2 100644 --- a/core/image_io/tiff.cpp +++ b/core/image_io/tiff.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/image_io/tiff.h b/core/image_io/tiff.h index ae68aa771b..676ea8482a 100644 --- a/core/image_io/tiff.h +++ b/core/image_io/tiff.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/interp/base.h b/core/interp/base.h index 54bee023a8..b8d452fadb 100644 --- a/core/interp/base.h +++ b/core/interp/base.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/interp/cubic.h b/core/interp/cubic.h index 10ab06fa4a..12e49e6057 100644 --- a/core/interp/cubic.h +++ b/core/interp/cubic.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/interp/linear.h b/core/interp/linear.h index b404c133ff..ec6af79659 100644 --- a/core/interp/linear.h +++ b/core/interp/linear.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/interp/nearest.h b/core/interp/nearest.h index fdfd9b0652..13ad0b542b 100644 --- a/core/interp/nearest.h +++ b/core/interp/nearest.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/interp/sinc.h b/core/interp/sinc.h index 8886ef3f97..063bf2f9c8 100644 --- a/core/interp/sinc.h +++ b/core/interp/sinc.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/SH.cpp b/core/math/SH.cpp index b27c519f90..30e1192d84 100644 --- a/core/math/SH.cpp +++ b/core/math/SH.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/SH.h b/core/math/SH.h index 82ab7f2475..bc1b3d8b52 100644 --- a/core/math/SH.h +++ b/core/math/SH.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/Sn_scale_estimator.h b/core/math/Sn_scale_estimator.h index d358014a82..7e05f761c5 100644 --- a/core/math/Sn_scale_estimator.h +++ b/core/math/Sn_scale_estimator.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/ZSH.h b/core/math/ZSH.h index df4b9d374e..5423e3622a 100644 --- a/core/math/ZSH.h +++ b/core/math/ZSH.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/average_space.cpp b/core/math/average_space.cpp index 2bd0a3848b..ec0ef7b499 100644 --- a/core/math/average_space.cpp +++ b/core/math/average_space.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/average_space.h b/core/math/average_space.h index 10bbae7a37..3a82ced3aa 100644 --- a/core/math/average_space.h +++ b/core/math/average_space.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/bessel.cpp b/core/math/bessel.cpp index 9821368df8..58d68f4eea 100644 --- a/core/math/bessel.cpp +++ b/core/math/bessel.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/bessel.h b/core/math/bessel.h index 15840a0e6a..48bc6cccb5 100644 --- a/core/math/bessel.h +++ b/core/math/bessel.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/cauchy.h b/core/math/cauchy.h index 52dc1f9fbf..c75484a496 100644 --- a/core/math/cauchy.h +++ b/core/math/cauchy.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/chebyshev.h b/core/math/chebyshev.h index 94c2d9c6d9..1404c008b0 100644 --- a/core/math/chebyshev.h +++ b/core/math/chebyshev.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/check_gradient.h b/core/math/check_gradient.h index e22c600dfc..51180bbb8a 100644 --- a/core/math/check_gradient.h +++ b/core/math/check_gradient.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/constrained_least_squares.h b/core/math/constrained_least_squares.h index 56821cf744..42eafa6ae4 100644 --- a/core/math/constrained_least_squares.h +++ b/core/math/constrained_least_squares.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/cubic_spline.h b/core/math/cubic_spline.h index 8d94088f84..02154affe8 100644 --- a/core/math/cubic_spline.h +++ b/core/math/cubic_spline.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/gaussian.h b/core/math/gaussian.h index bc84887fb2..8663d3f68a 100644 --- a/core/math/gaussian.h +++ b/core/math/gaussian.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/golden_section_search.h b/core/math/golden_section_search.h index af2cd1697d..fb3fcfaad6 100644 --- a/core/math/golden_section_search.h +++ b/core/math/golden_section_search.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/gradient_descent.h b/core/math/gradient_descent.h index 5775ca8527..a48e84e299 100644 --- a/core/math/gradient_descent.h +++ b/core/math/gradient_descent.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/gradient_descent_bb.h b/core/math/gradient_descent_bb.h index 13426b20a5..06b463a4c2 100644 --- a/core/math/gradient_descent_bb.h +++ b/core/math/gradient_descent_bb.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/hermite.h b/core/math/hermite.h index c566840926..ba62b7bf44 100644 --- a/core/math/hermite.h +++ b/core/math/hermite.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/least_squares.h b/core/math/least_squares.h index 8493ad60a5..2fbec93ab9 100644 --- a/core/math/least_squares.h +++ b/core/math/least_squares.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/legendre.h b/core/math/legendre.h index f061cd5aaf..a0acb3c0f1 100644 --- a/core/math/legendre.h +++ b/core/math/legendre.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/math.h b/core/math/math.h index 7be40b67ba..4b680264aa 100644 --- a/core/math/math.h +++ b/core/math/math.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/median.h b/core/math/median.h index 831e5ccbc0..4e22c37bcb 100644 --- a/core/math/median.h +++ b/core/math/median.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/quadratic_line_search.h b/core/math/quadratic_line_search.h index 0e7ecad19b..1fc113b215 100644 --- a/core/math/quadratic_line_search.h +++ b/core/math/quadratic_line_search.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/rician.h b/core/math/rician.h index 1e8b21e727..1fdc893658 100644 --- a/core/math/rician.h +++ b/core/math/rician.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/rng.h b/core/math/rng.h index 869b72d625..7c7f78802b 100644 --- a/core/math/rng.h +++ b/core/math/rng.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/sech.h b/core/math/sech.h index 60a8c9a2e0..2ec2088cd3 100644 --- a/core/math/sech.h +++ b/core/math/sech.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/sinc.h b/core/math/sinc.h index 5d0eb5c1c0..32052ca8c4 100644 --- a/core/math/sinc.h +++ b/core/math/sinc.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/sphere.h b/core/math/sphere.h index dea8773c23..5cae64d5d3 100644 --- a/core/math/sphere.h +++ b/core/math/sphere.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/stats/glm.cpp b/core/math/stats/glm.cpp index f0227f184d..a8846de35a 100644 --- a/core/math/stats/glm.cpp +++ b/core/math/stats/glm.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/stats/glm.h b/core/math/stats/glm.h index 76db4c890d..5feb8db111 100644 --- a/core/math/stats/glm.h +++ b/core/math/stats/glm.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/stats/permutation.cpp b/core/math/stats/permutation.cpp index 4780b6ff8e..8c4a8ad80a 100644 --- a/core/math/stats/permutation.cpp +++ b/core/math/stats/permutation.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/stats/permutation.h b/core/math/stats/permutation.h index d9d6c9d8d9..aedfffe270 100644 --- a/core/math/stats/permutation.h +++ b/core/math/stats/permutation.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/stats/typedefs.h b/core/math/stats/typedefs.h index 268789105b..d02addbc31 100644 --- a/core/math/stats/typedefs.h +++ b/core/math/stats/typedefs.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/math/versor.h b/core/math/versor.h index e7a47c53e6..310e5b30a3 100644 --- a/core/math/versor.h +++ b/core/math/versor.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/memory.h b/core/memory.h index bf0ec77290..e34c26b78d 100644 --- a/core/memory.h +++ b/core/memory.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/mrtrix.cpp b/core/mrtrix.cpp index c6f38c6f3d..dca45bdda6 100644 --- a/core/mrtrix.cpp +++ b/core/mrtrix.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/mrtrix.h b/core/mrtrix.h index 6a05cfba2d..24cf03e757 100644 --- a/core/mrtrix.h +++ b/core/mrtrix.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/phase_encoding.cpp b/core/phase_encoding.cpp index 877caf15bb..45726e2b3d 100644 --- a/core/phase_encoding.cpp +++ b/core/phase_encoding.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/phase_encoding.h b/core/phase_encoding.h index cd19776665..f5b655ceee 100644 --- a/core/phase_encoding.h +++ b/core/phase_encoding.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/progressbar.cpp b/core/progressbar.cpp index 91ba951eca..56233d382e 100644 --- a/core/progressbar.cpp +++ b/core/progressbar.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/progressbar.h b/core/progressbar.h index 0d2268d535..1e3bb2ca6c 100644 --- a/core/progressbar.h +++ b/core/progressbar.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/raw.h b/core/raw.h index 1a38852b89..6ac8f48749 100644 --- a/core/raw.h +++ b/core/raw.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/signal_handler.cpp b/core/signal_handler.cpp index ef7a7250c2..c117011686 100644 --- a/core/signal_handler.cpp +++ b/core/signal_handler.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/signal_handler.h b/core/signal_handler.h index c2e4147951..61cb6e7f41 100644 --- a/core/signal_handler.h +++ b/core/signal_handler.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/signals.h b/core/signals.h index b882ba00bd..f5c6eb87a7 100644 --- a/core/signals.h +++ b/core/signals.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/stats.cpp b/core/stats.cpp index 2f4f28f31e..7a47dc65c2 100644 --- a/core/stats.cpp +++ b/core/stats.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/stats.h b/core/stats.h index 881761db28..fd14fce7a3 100644 --- a/core/stats.h +++ b/core/stats.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/stride.cpp b/core/stride.cpp index 243a24d196..b44575c8f0 100644 --- a/core/stride.cpp +++ b/core/stride.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/stride.h b/core/stride.h index 03b04b1f90..79691951de 100644 --- a/core/stride.h +++ b/core/stride.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/thread.cpp b/core/thread.cpp index 1be80a5518..f9a81233c0 100644 --- a/core/thread.cpp +++ b/core/thread.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/thread.h b/core/thread.h index 7058ba52d3..bcb5a8301e 100644 --- a/core/thread.h +++ b/core/thread.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/thread_queue.h b/core/thread_queue.h index 1903e8ca59..f46b003b3f 100644 --- a/core/thread_queue.h +++ b/core/thread_queue.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/timer.h b/core/timer.h index 17f7d68b99..df60e45618 100644 --- a/core/timer.h +++ b/core/timer.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/transform.h b/core/transform.h index 3efa566e25..330db03b86 100644 --- a/core/transform.h +++ b/core/transform.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/core/types.h b/core/types.h index dce0824b9a..67319481e1 100644 --- a/core/types.h +++ b/core/types.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/docs/reference/commands/5tt2gmwmi.rst b/docs/reference/commands/5tt2gmwmi.rst index 068ea14d0d..b71c171b4d 100644 --- a/docs/reference/commands/5tt2gmwmi.rst +++ b/docs/reference/commands/5tt2gmwmi.rst @@ -51,16 +51,16 @@ Smith, R. E.; Tournier, J.-D.; Calamante, F. & Connelly, A. Anatomically-constra **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/5tt2vis.rst b/docs/reference/commands/5tt2vis.rst index 2065b405b2..df82efc172 100644 --- a/docs/reference/commands/5tt2vis.rst +++ b/docs/reference/commands/5tt2vis.rst @@ -56,16 +56,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/5ttcheck.rst b/docs/reference/commands/5ttcheck.rst index 768e5a681e..0c6f58361d 100644 --- a/docs/reference/commands/5ttcheck.rst +++ b/docs/reference/commands/5ttcheck.rst @@ -45,16 +45,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/5ttedit.rst b/docs/reference/commands/5ttedit.rst index ef0326ad47..c7abd495de 100644 --- a/docs/reference/commands/5ttedit.rst +++ b/docs/reference/commands/5ttedit.rst @@ -56,16 +56,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/afdconnectivity.rst b/docs/reference/commands/afdconnectivity.rst index fe2d48db4e..1d4cfcf18e 100644 --- a/docs/reference/commands/afdconnectivity.rst +++ b/docs/reference/commands/afdconnectivity.rst @@ -63,16 +63,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) and Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/amp2response.rst b/docs/reference/commands/amp2response.rst index e0d4ded4bb..cd27f976ba 100644 --- a/docs/reference/commands/amp2response.rst +++ b/docs/reference/commands/amp2response.rst @@ -68,16 +68,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/amp2sh.rst b/docs/reference/commands/amp2sh.rst index 36f8bac0e4..231c0a14a0 100644 --- a/docs/reference/commands/amp2sh.rst +++ b/docs/reference/commands/amp2sh.rst @@ -80,16 +80,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/connectome2tck.rst b/docs/reference/commands/connectome2tck.rst index 5b84b2ddc3..65d721fd38 100644 --- a/docs/reference/commands/connectome2tck.rst +++ b/docs/reference/commands/connectome2tck.rst @@ -72,16 +72,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/connectomestats.rst b/docs/reference/commands/connectomestats.rst index b98666d10c..5705ee689b 100644 --- a/docs/reference/commands/connectomestats.rst +++ b/docs/reference/commands/connectomestats.rst @@ -85,16 +85,16 @@ References **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/dcmedit.rst b/docs/reference/commands/dcmedit.rst index a9c2e332d1..a40c254091 100644 --- a/docs/reference/commands/dcmedit.rst +++ b/docs/reference/commands/dcmedit.rst @@ -56,16 +56,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/dcminfo.rst b/docs/reference/commands/dcminfo.rst index 973508d1c0..e44e7fa343 100644 --- a/docs/reference/commands/dcminfo.rst +++ b/docs/reference/commands/dcminfo.rst @@ -49,16 +49,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/dirflip.rst b/docs/reference/commands/dirflip.rst index 289bcae090..334a95f878 100644 --- a/docs/reference/commands/dirflip.rst +++ b/docs/reference/commands/dirflip.rst @@ -53,16 +53,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/dirgen.rst b/docs/reference/commands/dirgen.rst index dfb4c60377..d4a5846569 100644 --- a/docs/reference/commands/dirgen.rst +++ b/docs/reference/commands/dirgen.rst @@ -66,16 +66,16 @@ Papadakis, N. G.; Murrills, C. D.; Hall, L. D.; Huang, C. L.-H. & Adrian Carpent **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/dirmerge.rst b/docs/reference/commands/dirmerge.rst index e2787ce8ed..3ec224cfd8 100644 --- a/docs/reference/commands/dirmerge.rst +++ b/docs/reference/commands/dirmerge.rst @@ -47,16 +47,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/dirorder.rst b/docs/reference/commands/dirorder.rst index 8a91a1e38d..a59b40eee6 100644 --- a/docs/reference/commands/dirorder.rst +++ b/docs/reference/commands/dirorder.rst @@ -46,16 +46,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/dirsplit.rst b/docs/reference/commands/dirsplit.rst index 7be0cf5d00..735e63fa97 100644 --- a/docs/reference/commands/dirsplit.rst +++ b/docs/reference/commands/dirsplit.rst @@ -48,16 +48,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/dirstat.rst b/docs/reference/commands/dirstat.rst index ea2ccc69a5..a1bca50de3 100644 --- a/docs/reference/commands/dirstat.rst +++ b/docs/reference/commands/dirstat.rst @@ -82,16 +82,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/dwi2adc.rst b/docs/reference/commands/dwi2adc.rst index a43c50f2ed..c9bde10c48 100644 --- a/docs/reference/commands/dwi2adc.rst +++ b/docs/reference/commands/dwi2adc.rst @@ -53,16 +53,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/dwi2fod.rst b/docs/reference/commands/dwi2fod.rst index eac1bbd25c..c1e76a2095 100644 --- a/docs/reference/commands/dwi2fod.rst +++ b/docs/reference/commands/dwi2fod.rst @@ -100,16 +100,16 @@ Tournier, J.-D.; Calamante, F., Gadian, D.G. & Connelly, A. Direct estimation of **Author:** J-Donald Tournier (jdtournier@gmail.com) and Ben Jeurissen (ben.jeurissen@uantwerpen.be) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/dwi2mask.rst b/docs/reference/commands/dwi2mask.rst index 863e02aced..91ad827cce 100644 --- a/docs/reference/commands/dwi2mask.rst +++ b/docs/reference/commands/dwi2mask.rst @@ -67,16 +67,16 @@ Dhollander T, Raffelt D, Connelly A. Unsupervised 3-tissue response function est **Author:** David Raffelt (david.raffelt@florey.edu.au), Thijs Dhollander (thijs.dhollander@gmail.com) and Ben Jeurissen (ben.jeurissen@uantwerpen.be) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/dwi2tensor.rst b/docs/reference/commands/dwi2tensor.rst index bb59a99ea2..e0e84665f8 100644 --- a/docs/reference/commands/dwi2tensor.rst +++ b/docs/reference/commands/dwi2tensor.rst @@ -73,16 +73,16 @@ Veraart, J.; Sijbers, J.; Sunaert, S.; Leemans, A. & Jeurissen, B. Weighted line **Author:** Ben Jeurissen (ben.jeurissen@uantwerpen.be) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/dwiextract.rst b/docs/reference/commands/dwiextract.rst index 420183051c..f73fa8151d 100644 --- a/docs/reference/commands/dwiextract.rst +++ b/docs/reference/commands/dwiextract.rst @@ -81,16 +81,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) and Thijs Dhollander (thijs.dhollander@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/dwinormalise.rst b/docs/reference/commands/dwinormalise.rst index 49a620267d..875622b12c 100644 --- a/docs/reference/commands/dwinormalise.rst +++ b/docs/reference/commands/dwinormalise.rst @@ -58,16 +58,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/fixel2sh.rst b/docs/reference/commands/fixel2sh.rst index 843abc7f9b..46c180b843 100644 --- a/docs/reference/commands/fixel2sh.rst +++ b/docs/reference/commands/fixel2sh.rst @@ -51,16 +51,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) & David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/fixel2tsf.rst b/docs/reference/commands/fixel2tsf.rst index 42e5008ee7..1f1e91d858 100644 --- a/docs/reference/commands/fixel2tsf.rst +++ b/docs/reference/commands/fixel2tsf.rst @@ -52,16 +52,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/fixel2voxel.rst b/docs/reference/commands/fixel2voxel.rst index 50dfee4b1e..f6419621fd 100644 --- a/docs/reference/commands/fixel2voxel.rst +++ b/docs/reference/commands/fixel2voxel.rst @@ -71,16 +71,16 @@ References **Author:** Robert E. Smith (robert.smith@florey.edu.au) & David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/fixelcfestats.rst b/docs/reference/commands/fixelcfestats.rst index cb576dc456..8bea746e8c 100644 --- a/docs/reference/commands/fixelcfestats.rst +++ b/docs/reference/commands/fixelcfestats.rst @@ -99,16 +99,16 @@ Raffelt, D.; Smith, RE.; Ridgway, GR.; Tournier, JD.; Vaughan, DN.; Rose, S.; He **Author:** David Raffelt (david.raffelt@florey.edu.au) and Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/fixelconvert.rst b/docs/reference/commands/fixelconvert.rst index 82ea994eba..777a360f1d 100644 --- a/docs/reference/commands/fixelconvert.rst +++ b/docs/reference/commands/fixelconvert.rst @@ -62,16 +62,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) and Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/fixelcorrespondence.rst b/docs/reference/commands/fixelcorrespondence.rst index b889aa6e0d..7fa772a63b 100644 --- a/docs/reference/commands/fixelcorrespondence.rst +++ b/docs/reference/commands/fixelcorrespondence.rst @@ -53,16 +53,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/fixelcrop.rst b/docs/reference/commands/fixelcrop.rst index ab83acc6e2..f24c7dbd6f 100644 --- a/docs/reference/commands/fixelcrop.rst +++ b/docs/reference/commands/fixelcrop.rst @@ -50,16 +50,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) & Rami Tabarra (rami.tabarra@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/fixelreorient.rst b/docs/reference/commands/fixelreorient.rst index 09e6c69e9e..7bdcf6ca53 100644 --- a/docs/reference/commands/fixelreorient.rst +++ b/docs/reference/commands/fixelreorient.rst @@ -50,16 +50,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/fod2fixel.rst b/docs/reference/commands/fod2fixel.rst index 22e0812526..c6c0039b15 100644 --- a/docs/reference/commands/fod2fixel.rst +++ b/docs/reference/commands/fod2fixel.rst @@ -82,16 +82,16 @@ References **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/label2colour.rst b/docs/reference/commands/label2colour.rst index 10a3d6a9e9..49f59ee563 100644 --- a/docs/reference/commands/label2colour.rst +++ b/docs/reference/commands/label2colour.rst @@ -51,16 +51,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/label2mesh.rst b/docs/reference/commands/label2mesh.rst index 31cae3dc54..8f3dc196f7 100644 --- a/docs/reference/commands/label2mesh.rst +++ b/docs/reference/commands/label2mesh.rst @@ -46,16 +46,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/labelconvert.rst b/docs/reference/commands/labelconvert.rst index 590aa08b40..f012cea550 100644 --- a/docs/reference/commands/labelconvert.rst +++ b/docs/reference/commands/labelconvert.rst @@ -53,16 +53,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/maskdump.rst b/docs/reference/commands/maskdump.rst index 9336abb766..0299037ad5 100644 --- a/docs/reference/commands/maskdump.rst +++ b/docs/reference/commands/maskdump.rst @@ -49,16 +49,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/maskfilter.rst b/docs/reference/commands/maskfilter.rst index b500fb95b5..79eecf4b1c 100644 --- a/docs/reference/commands/maskfilter.rst +++ b/docs/reference/commands/maskfilter.rst @@ -81,16 +81,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au), David Raffelt (david.raffelt@florey.edu.au), Thijs Dhollander (thijs.dhollander@gmail.com) and J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mesh2voxel.rst b/docs/reference/commands/mesh2voxel.rst index b374d6e764..deda019e1a 100644 --- a/docs/reference/commands/mesh2voxel.rst +++ b/docs/reference/commands/mesh2voxel.rst @@ -50,16 +50,16 @@ Smith, R. E.; Tournier, J.-D.; Calamante, F. & Connelly, A. Anatomically-constra **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/meshconvert.rst b/docs/reference/commands/meshconvert.rst index b05bc861c8..6501f17210 100644 --- a/docs/reference/commands/meshconvert.rst +++ b/docs/reference/commands/meshconvert.rst @@ -48,16 +48,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/meshfilter.rst b/docs/reference/commands/meshfilter.rst index 3a718eeb48..509395faf7 100644 --- a/docs/reference/commands/meshfilter.rst +++ b/docs/reference/commands/meshfilter.rst @@ -52,16 +52,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mraverageheader.rst b/docs/reference/commands/mraverageheader.rst index d71192b624..f251ac0731 100644 --- a/docs/reference/commands/mraverageheader.rst +++ b/docs/reference/commands/mraverageheader.rst @@ -55,16 +55,16 @@ Standard options **Author:** Maximilian Pietsch (maximilian.pietsch@kcl.ac.uk) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrcalc.rst b/docs/reference/commands/mrcalc.rst index e1d9ccbc19..c286e4764c 100644 --- a/docs/reference/commands/mrcalc.rst +++ b/docs/reference/commands/mrcalc.rst @@ -166,16 +166,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrcat.rst b/docs/reference/commands/mrcat.rst index be682e2fec..29607504c0 100644 --- a/docs/reference/commands/mrcat.rst +++ b/docs/reference/commands/mrcat.rst @@ -52,16 +52,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrcheckerboardmask.rst b/docs/reference/commands/mrcheckerboardmask.rst index f51851428c..becbefdb90 100644 --- a/docs/reference/commands/mrcheckerboardmask.rst +++ b/docs/reference/commands/mrcheckerboardmask.rst @@ -50,16 +50,16 @@ Standard options **Author:** Max Pietsch (maximilian.pietsch@kcl.ac.uk) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrclusterstats.rst b/docs/reference/commands/mrclusterstats.rst index 9987c1eb31..0c7738ffd9 100644 --- a/docs/reference/commands/mrclusterstats.rst +++ b/docs/reference/commands/mrclusterstats.rst @@ -87,16 +87,16 @@ References **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrconvert.rst b/docs/reference/commands/mrconvert.rst index 11884189d0..f0ef91ba86 100644 --- a/docs/reference/commands/mrconvert.rst +++ b/docs/reference/commands/mrconvert.rst @@ -128,16 +128,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) and Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrcrop.rst b/docs/reference/commands/mrcrop.rst index cf7d17d025..f713cafc22 100644 --- a/docs/reference/commands/mrcrop.rst +++ b/docs/reference/commands/mrcrop.rst @@ -57,16 +57,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrdegibbs.rst b/docs/reference/commands/mrdegibbs.rst index 31dfa88026..e8382f752f 100644 --- a/docs/reference/commands/mrdegibbs.rst +++ b/docs/reference/commands/mrdegibbs.rst @@ -71,16 +71,16 @@ Kellner, E; Dhital, B; Kiselev, V.G & Reisert, M. Gibbs-ringing artifact removal **Author:** Ben Jeurissen (ben.jeurissen@uantwerpen.be) & J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrdump.rst b/docs/reference/commands/mrdump.rst index 9b5317e143..70bd985252 100644 --- a/docs/reference/commands/mrdump.rst +++ b/docs/reference/commands/mrdump.rst @@ -51,16 +51,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mredit.rst b/docs/reference/commands/mredit.rst index 44993ad4f6..28c7b6bea8 100644 --- a/docs/reference/commands/mredit.rst +++ b/docs/reference/commands/mredit.rst @@ -57,16 +57,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrfilter.rst b/docs/reference/commands/mrfilter.rst index 6daf6c8fa3..bac4519d6c 100644 --- a/docs/reference/commands/mrfilter.rst +++ b/docs/reference/commands/mrfilter.rst @@ -98,16 +98,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au), David Raffelt (david.raffelt@florey.edu.au) and J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrhistmatch.rst b/docs/reference/commands/mrhistmatch.rst index c620a0719b..2ecf7b6511 100644 --- a/docs/reference/commands/mrhistmatch.rst +++ b/docs/reference/commands/mrhistmatch.rst @@ -58,16 +58,16 @@ References **Author:** Robert E. Smith (robert.smith@florey.edu.au -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrhistogram.rst b/docs/reference/commands/mrhistogram.rst index 4827481dd5..1fa171d27e 100644 --- a/docs/reference/commands/mrhistogram.rst +++ b/docs/reference/commands/mrhistogram.rst @@ -60,16 +60,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrinfo.rst b/docs/reference/commands/mrinfo.rst index 761764176f..e33dc28d8d 100644 --- a/docs/reference/commands/mrinfo.rst +++ b/docs/reference/commands/mrinfo.rst @@ -116,16 +116,16 @@ Standard options **Author:** J-Donald Tournier (d.tournier@brain.org.au) and Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrmath.rst b/docs/reference/commands/mrmath.rst index 18924ae4fd..1968c38bec 100644 --- a/docs/reference/commands/mrmath.rst +++ b/docs/reference/commands/mrmath.rst @@ -61,16 +61,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrmesh.rst b/docs/reference/commands/mrmesh.rst index 232f47cfee..b285c0fe4b 100644 --- a/docs/reference/commands/mrmesh.rst +++ b/docs/reference/commands/mrmesh.rst @@ -48,16 +48,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrmetric.rst b/docs/reference/commands/mrmetric.rst index 013b0802af..d242af6564 100644 --- a/docs/reference/commands/mrmetric.rst +++ b/docs/reference/commands/mrmetric.rst @@ -63,16 +63,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) and Max Pietsch (maximilian.pietsch@kcl.ac.uk) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrpad.rst b/docs/reference/commands/mrpad.rst index 976274b06b..2bd3efd792 100644 --- a/docs/reference/commands/mrpad.rst +++ b/docs/reference/commands/mrpad.rst @@ -48,16 +48,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrregister.rst b/docs/reference/commands/mrregister.rst index d4f50253db..265bea2655 100644 --- a/docs/reference/commands/mrregister.rst +++ b/docs/reference/commands/mrregister.rst @@ -191,16 +191,16 @@ Raffelt, D.; Tournier, J.-D.; Crozier, S.; Connelly, A. & Salvado, O. Reorientat **Author:** David Raffelt (david.raffelt@florey.edu.au) & Max Pietsch (maximilian.pietsch@kcl.ac.uk) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrresize.rst b/docs/reference/commands/mrresize.rst index fd61a4c27b..2c3021feeb 100644 --- a/docs/reference/commands/mrresize.rst +++ b/docs/reference/commands/mrresize.rst @@ -64,16 +64,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrstats.rst b/docs/reference/commands/mrstats.rst index 22033f5423..8b309f41d6 100644 --- a/docs/reference/commands/mrstats.rst +++ b/docs/reference/commands/mrstats.rst @@ -57,16 +57,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrthreshold.rst b/docs/reference/commands/mrthreshold.rst index a23fd978a6..b453e303a3 100644 --- a/docs/reference/commands/mrthreshold.rst +++ b/docs/reference/commands/mrthreshold.rst @@ -74,16 +74,16 @@ References **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrtransform.rst b/docs/reference/commands/mrtransform.rst index 01b712c10c..04593f7a3c 100644 --- a/docs/reference/commands/mrtransform.rst +++ b/docs/reference/commands/mrtransform.rst @@ -120,16 +120,16 @@ References **Author:** J-Donald Tournier (jdtournier@gmail.com) and David Raffelt (david.raffelt@florey.edu.au) and Max Pietsch (maximilian.pietsch@kcl.ac.uk) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mrview.rst b/docs/reference/commands/mrview.rst index 6a8677168a..518a556dae 100644 --- a/docs/reference/commands/mrview.rst +++ b/docs/reference/commands/mrview.rst @@ -194,16 +194,16 @@ Tournier, J.-D.; Calamante, F. & Connelly, A. MRtrix: Diffusion tractography in **Author:** J-Donald Tournier (jdtournier@gmail.com), Dave Raffelt (david.raffelt@florey.edu.au), Robert E. Smith (robert.smith@florey.edu.au), Rami Tabbara (rami.tabbara@florey.edu.au), Max Pietsch (maximilian.pietsch@kcl.ac.uk), Thijs Dhollander (thijs.dhollander@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/mtnormalise.rst b/docs/reference/commands/mtnormalise.rst index 8c0cb1a956..5f8efa2d77 100644 --- a/docs/reference/commands/mtnormalise.rst +++ b/docs/reference/commands/mtnormalise.rst @@ -64,16 +64,16 @@ Standard options **Author:** Thijs Dhollander (thijs.dhollander@gmail.com), Rami Tabbara (rami.tabbara@florey.edu.au) and David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/peaks2amp.rst b/docs/reference/commands/peaks2amp.rst index 4bc79400e0..b0423a2957 100644 --- a/docs/reference/commands/peaks2amp.rst +++ b/docs/reference/commands/peaks2amp.rst @@ -44,16 +44,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/sh2amp.rst b/docs/reference/commands/sh2amp.rst index bd608d3b8b..9fb5d11e0b 100644 --- a/docs/reference/commands/sh2amp.rst +++ b/docs/reference/commands/sh2amp.rst @@ -59,16 +59,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/sh2peaks.rst b/docs/reference/commands/sh2peaks.rst index 28de1883e6..23e9fff95a 100644 --- a/docs/reference/commands/sh2peaks.rst +++ b/docs/reference/commands/sh2peaks.rst @@ -56,16 +56,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/sh2power.rst b/docs/reference/commands/sh2power.rst index 56184f818a..191d4da208 100644 --- a/docs/reference/commands/sh2power.rst +++ b/docs/reference/commands/sh2power.rst @@ -51,16 +51,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/sh2response.rst b/docs/reference/commands/sh2response.rst index 888af2553d..b4515d27eb 100644 --- a/docs/reference/commands/sh2response.rst +++ b/docs/reference/commands/sh2response.rst @@ -50,16 +50,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/shbasis.rst b/docs/reference/commands/shbasis.rst index 2b9c36d2c0..e544605428 100644 --- a/docs/reference/commands/shbasis.rst +++ b/docs/reference/commands/shbasis.rst @@ -52,16 +52,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/shconv.rst b/docs/reference/commands/shconv.rst index 0a9acfeaa2..fc98d7ae71 100644 --- a/docs/reference/commands/shconv.rst +++ b/docs/reference/commands/shconv.rst @@ -52,16 +52,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/shview.rst b/docs/reference/commands/shview.rst index cc0abf5513..9bb52696fb 100644 --- a/docs/reference/commands/shview.rst +++ b/docs/reference/commands/shview.rst @@ -45,16 +45,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tck2connectome.rst b/docs/reference/commands/tck2connectome.rst index d2a2e623be..c7e3539d54 100644 --- a/docs/reference/commands/tck2connectome.rst +++ b/docs/reference/commands/tck2connectome.rst @@ -89,16 +89,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tck2fixel.rst b/docs/reference/commands/tck2fixel.rst index 2f18b7fcd4..dcd32f8652 100644 --- a/docs/reference/commands/tck2fixel.rst +++ b/docs/reference/commands/tck2fixel.rst @@ -48,16 +48,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tckconvert.rst b/docs/reference/commands/tckconvert.rst index eece80a228..d830cc30ee 100644 --- a/docs/reference/commands/tckconvert.rst +++ b/docs/reference/commands/tckconvert.rst @@ -80,16 +80,16 @@ Standard options **Author:** Daan Christiaens (daan.christiaens@kcl.ac.uk), J-Donald Tournier (jdtournier@gmail.com), Philip Broser (philip.broser@me.com), Daniel Blezek (daniel.blezek@gmail.com). -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tckdfc.rst b/docs/reference/commands/tckdfc.rst index a4e6d0a00e..9bbcf47cf7 100644 --- a/docs/reference/commands/tckdfc.rst +++ b/docs/reference/commands/tckdfc.rst @@ -86,16 +86,16 @@ Calamante, F.; Smith, R.E.; Liang, X.; Zalesky, A.; Connelly, A Track-weighted d **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tckedit.rst b/docs/reference/commands/tckedit.rst index 7b17a89cd9..90bcf2a561 100644 --- a/docs/reference/commands/tckedit.rst +++ b/docs/reference/commands/tckedit.rst @@ -95,16 +95,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tckgen.rst b/docs/reference/commands/tckgen.rst index 0a3b74438b..5fe8cd27cd 100644 --- a/docs/reference/commands/tckgen.rst +++ b/docs/reference/commands/tckgen.rst @@ -185,16 +185,16 @@ References based on command-line options: **Author:** J-Donald Tournier (jdtournier@gmail.com) and Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tckinfo.rst b/docs/reference/commands/tckinfo.rst index b5920e5490..13db7d8081 100644 --- a/docs/reference/commands/tckinfo.rst +++ b/docs/reference/commands/tckinfo.rst @@ -45,16 +45,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tckmap.rst b/docs/reference/commands/tckmap.rst index 9993394a30..8e037ed9a7 100644 --- a/docs/reference/commands/tckmap.rst +++ b/docs/reference/commands/tckmap.rst @@ -114,16 +114,16 @@ References **Author:** Robert E. Smith (robert.smith@florey.edu.au) and J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tckresample.rst b/docs/reference/commands/tckresample.rst index ddba279359..8379205b0e 100644 --- a/docs/reference/commands/tckresample.rst +++ b/docs/reference/commands/tckresample.rst @@ -68,16 +68,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) and J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tcksample.rst b/docs/reference/commands/tcksample.rst index 6f52525347..10869ea619 100644 --- a/docs/reference/commands/tcksample.rst +++ b/docs/reference/commands/tcksample.rst @@ -63,16 +63,16 @@ References **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tcksift.rst b/docs/reference/commands/tcksift.rst index 4ecec2fcd5..0d5ec3b98a 100644 --- a/docs/reference/commands/tcksift.rst +++ b/docs/reference/commands/tcksift.rst @@ -94,16 +94,16 @@ Smith, R. E.; Tournier, J.-D.; Calamante, F. & Connelly, A. SIFT: Spherical-deco **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tcksift2.rst b/docs/reference/commands/tcksift2.rst index 4c946beb3c..a31761b379 100644 --- a/docs/reference/commands/tcksift2.rst +++ b/docs/reference/commands/tcksift2.rst @@ -109,16 +109,16 @@ Smith, R. E.; Tournier, J.-D.; Calamante, F. & Connelly, A. SIFT2: Enabling dens **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tckstats.rst b/docs/reference/commands/tckstats.rst index a845e15610..b386a384cd 100644 --- a/docs/reference/commands/tckstats.rst +++ b/docs/reference/commands/tckstats.rst @@ -53,16 +53,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tcktransform.rst b/docs/reference/commands/tcktransform.rst index ebdc42bb18..b8b4d8f952 100644 --- a/docs/reference/commands/tcktransform.rst +++ b/docs/reference/commands/tcktransform.rst @@ -45,16 +45,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tensor2metric.rst b/docs/reference/commands/tensor2metric.rst index 4abaf6a0f3..73fd19829e 100644 --- a/docs/reference/commands/tensor2metric.rst +++ b/docs/reference/commands/tensor2metric.rst @@ -74,16 +74,16 @@ Westin, C. F.; Peled, S.; Gudbjartsson, H.; Kikinis, R. & Jolesz, F. A. Geometri **Author:** Thijs Dhollander (thijs.dhollander@gmail.com) & Ben Jeurissen (ben.jeurissen@uantwerpen.be) & J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/transformcalc.rst b/docs/reference/commands/transformcalc.rst index bb1233006c..8331903d36 100644 --- a/docs/reference/commands/transformcalc.rst +++ b/docs/reference/commands/transformcalc.rst @@ -80,16 +80,16 @@ Standard options **Author:** Max Pietsch (maximilian.pietsch@kcl.ac.uk) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/transformcompose.rst b/docs/reference/commands/transformcompose.rst index afbbbdfc87..6dd00a32da 100644 --- a/docs/reference/commands/transformcompose.rst +++ b/docs/reference/commands/transformcompose.rst @@ -51,16 +51,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/transformconvert.rst b/docs/reference/commands/transformconvert.rst index 407762c625..7d74d07014 100644 --- a/docs/reference/commands/transformconvert.rst +++ b/docs/reference/commands/transformconvert.rst @@ -50,16 +50,16 @@ Standard options **Author:** Max Pietsch (maximilian.pietsch@kcl.ac.uk) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tsfdivide.rst b/docs/reference/commands/tsfdivide.rst index 2553ab3f88..b01154ad12 100644 --- a/docs/reference/commands/tsfdivide.rst +++ b/docs/reference/commands/tsfdivide.rst @@ -45,16 +45,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tsfinfo.rst b/docs/reference/commands/tsfinfo.rst index 0339c2e6a5..2f216b8758 100644 --- a/docs/reference/commands/tsfinfo.rst +++ b/docs/reference/commands/tsfinfo.rst @@ -47,16 +47,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tsfmult.rst b/docs/reference/commands/tsfmult.rst index 8abea49eb4..96459f8552 100644 --- a/docs/reference/commands/tsfmult.rst +++ b/docs/reference/commands/tsfmult.rst @@ -45,16 +45,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tsfsmooth.rst b/docs/reference/commands/tsfsmooth.rst index 96ca3027ab..d3d2cc6962 100644 --- a/docs/reference/commands/tsfsmooth.rst +++ b/docs/reference/commands/tsfsmooth.rst @@ -46,16 +46,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/tsfthreshold.rst b/docs/reference/commands/tsfthreshold.rst index f4311390a7..c93fc31170 100644 --- a/docs/reference/commands/tsfthreshold.rst +++ b/docs/reference/commands/tsfthreshold.rst @@ -47,16 +47,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/vectorstats.rst b/docs/reference/commands/vectorstats.rst index 89f74fc11b..633c007249 100644 --- a/docs/reference/commands/vectorstats.rst +++ b/docs/reference/commands/vectorstats.rst @@ -55,16 +55,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/voxel2fixel.rst b/docs/reference/commands/voxel2fixel.rst index 838128ba8b..e0d7061013 100644 --- a/docs/reference/commands/voxel2fixel.rst +++ b/docs/reference/commands/voxel2fixel.rst @@ -51,16 +51,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/warp2metric.rst b/docs/reference/commands/warp2metric.rst index d70234d216..6528652720 100644 --- a/docs/reference/commands/warp2metric.rst +++ b/docs/reference/commands/warp2metric.rst @@ -54,16 +54,16 @@ Raffelt, D.; Tournier, JD/; Smith, RE.; Vaughan, DN.; Jackson, G.; Ridgway, GR. **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/warpconvert.rst b/docs/reference/commands/warpconvert.rst index d01957bea2..f5d282a1e3 100644 --- a/docs/reference/commands/warpconvert.rst +++ b/docs/reference/commands/warpconvert.rst @@ -56,16 +56,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/warpcorrect.rst b/docs/reference/commands/warpcorrect.rst index c0c680cd52..5e4b7cb506 100644 --- a/docs/reference/commands/warpcorrect.rst +++ b/docs/reference/commands/warpcorrect.rst @@ -49,16 +49,16 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/warpinit.rst b/docs/reference/commands/warpinit.rst index 2cc6e45939..8025b3079e 100644 --- a/docs/reference/commands/warpinit.rst +++ b/docs/reference/commands/warpinit.rst @@ -55,16 +55,16 @@ Standard options **Author:** J-Donald Tournier (jdtournier@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/commands/warpinvert.rst b/docs/reference/commands/warpinvert.rst index 4a587581ce..5d6140b78c 100644 --- a/docs/reference/commands/warpinvert.rst +++ b/docs/reference/commands/warpinvert.rst @@ -53,16 +53,16 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) and David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/scripts/5ttgen.rst b/docs/reference/scripts/5ttgen.rst index 6d69b93270..4a0cdeecc9 100644 --- a/docs/reference/scripts/5ttgen.rst +++ b/docs/reference/scripts/5ttgen.rst @@ -66,17 +66,17 @@ References **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ .. _5ttgen_freesurfer: @@ -145,17 +145,17 @@ References **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ .. _5ttgen_fsl: @@ -236,15 +236,15 @@ References **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/scripts/dwi2response.rst b/docs/reference/scripts/dwi2response.rst index 282911b813..7e6cf58620 100644 --- a/docs/reference/scripts/dwi2response.rst +++ b/docs/reference/scripts/dwi2response.rst @@ -69,17 +69,17 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) and Thijs Dhollander (thijs.dhollander@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ .. _dwi2response_dhollander: @@ -166,17 +166,17 @@ References **Author:** Thijs Dhollander (thijs.dhollander@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ .. _dwi2response_fa: @@ -257,17 +257,17 @@ References **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ .. _dwi2response_manual: @@ -340,17 +340,17 @@ Standard options **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ .. _dwi2response_msmt_5tt: @@ -436,17 +436,17 @@ References **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ .. _dwi2response_tax: @@ -527,17 +527,17 @@ References **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ .. _dwi2response_tournier: @@ -620,15 +620,15 @@ References **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/scripts/dwibiascorrect.rst b/docs/reference/scripts/dwibiascorrect.rst index bc74534841..640dccddd4 100644 --- a/docs/reference/scripts/dwibiascorrect.rst +++ b/docs/reference/scripts/dwibiascorrect.rst @@ -72,15 +72,15 @@ References **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/scripts/dwigradcheck.rst b/docs/reference/scripts/dwigradcheck.rst index 0330f94da4..eca80c25fd 100644 --- a/docs/reference/scripts/dwigradcheck.rst +++ b/docs/reference/scripts/dwigradcheck.rst @@ -73,15 +73,15 @@ References **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/scripts/dwiintensitynorm.rst b/docs/reference/scripts/dwiintensitynorm.rst index 6bb644df1d..6bb03f3600 100644 --- a/docs/reference/scripts/dwiintensitynorm.rst +++ b/docs/reference/scripts/dwiintensitynorm.rst @@ -61,15 +61,15 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/scripts/dwipreproc.rst b/docs/reference/scripts/dwipreproc.rst index 3431d9666e..56ba4c094c 100644 --- a/docs/reference/scripts/dwipreproc.rst +++ b/docs/reference/scripts/dwipreproc.rst @@ -116,15 +116,15 @@ References **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/scripts/labelsgmfix.rst b/docs/reference/scripts/labelsgmfix.rst index b38555206e..d87b739c8d 100644 --- a/docs/reference/scripts/labelsgmfix.rst +++ b/docs/reference/scripts/labelsgmfix.rst @@ -66,15 +66,15 @@ References **Author:** Robert E. Smith (robert.smith@florey.edu.au) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/docs/reference/scripts/population_template.rst b/docs/reference/scripts/population_template.rst index a16dddb286..5a8049ef76 100644 --- a/docs/reference/scripts/population_template.rst +++ b/docs/reference/scripts/population_template.rst @@ -108,15 +108,15 @@ Standard options **Author:** David Raffelt (david.raffelt@florey.edu.au) & Max Pietsch (maximilian.pietsch@kcl.ac.uk) & Thijs Dhollander (thijs.dhollander@gmail.com) -**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. +**Copyright:** Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/. +For more details, see http://www.mrtrix.org/ diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index 2f7557dec7..383fb707a5 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -52,17 +52,17 @@ -_defaultCopyright = '''Copyright (c) 2008-2017 the MRtrix3 contributors. +_defaultCopyright = '''Copyright (c) 2008-2018 the MRtrix3 contributors. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this -file, you can obtain one at http://mozilla.org/MPL/2.0/. +file, you can obtain one at http://mozilla.org/MPL/2.0/ -MRtrix is distributed in the hope that it will be useful, +MRtrix3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -For more details, see http://www.mrtrix.org/.''' +For more details, see http://www.mrtrix.org/''' diff --git a/src/connectome/connectome.cpp b/src/connectome/connectome.cpp index d8c02ac719..d4e08c1573 100644 --- a/src/connectome/connectome.cpp +++ b/src/connectome/connectome.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/connectome/connectome.h b/src/connectome/connectome.h index ca4d4d82bd..6f760991d1 100644 --- a/src/connectome/connectome.h +++ b/src/connectome/connectome.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/connectome/enhance.cpp b/src/connectome/enhance.cpp index 94303117d1..981b196c5c 100644 --- a/src/connectome/enhance.cpp +++ b/src/connectome/enhance.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/connectome/enhance.h b/src/connectome/enhance.h index 57859a6bf1..9630b612ce 100644 --- a/src/connectome/enhance.h +++ b/src/connectome/enhance.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/connectome/lut.cpp b/src/connectome/lut.cpp index f871929bec..c54df65066 100644 --- a/src/connectome/lut.cpp +++ b/src/connectome/lut.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/connectome/lut.h b/src/connectome/lut.h index bb6671a249..04b6f5c851 100644 --- a/src/connectome/lut.h +++ b/src/connectome/lut.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/connectome/mat2vec.h b/src/connectome/mat2vec.h index 5d1c7bf911..2f0cf194aa 100644 --- a/src/connectome/mat2vec.h +++ b/src/connectome/mat2vec.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/bootstrap.h b/src/dwi/bootstrap.h index c480329fca..29b5a7b799 100644 --- a/src/dwi/bootstrap.h +++ b/src/dwi/bootstrap.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/directions/file.cpp b/src/dwi/directions/file.cpp index 9e4c23a15a..6218012b0f 100644 --- a/src/dwi/directions/file.cpp +++ b/src/dwi/directions/file.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/directions/file.h b/src/dwi/directions/file.h index 17b6b404de..d0010e62e1 100644 --- a/src/dwi/directions/file.h +++ b/src/dwi/directions/file.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/directions/mask.cpp b/src/dwi/directions/mask.cpp index e2ae1d0466..af0f2619da 100644 --- a/src/dwi/directions/mask.cpp +++ b/src/dwi/directions/mask.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/directions/mask.h b/src/dwi/directions/mask.h index 4f607b36ca..7f009135b2 100644 --- a/src/dwi/directions/mask.h +++ b/src/dwi/directions/mask.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/directions/predefined.cpp b/src/dwi/directions/predefined.cpp index 66b580073b..82f9363ba1 100644 --- a/src/dwi/directions/predefined.cpp +++ b/src/dwi/directions/predefined.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/directions/predefined.h b/src/dwi/directions/predefined.h index bec7c7bf2d..231d0fe4e6 100644 --- a/src/dwi/directions/predefined.h +++ b/src/dwi/directions/predefined.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/directions/set.cpp b/src/dwi/directions/set.cpp index a7e77c975d..b6f37f056b 100644 --- a/src/dwi/directions/set.cpp +++ b/src/dwi/directions/set.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/directions/set.h b/src/dwi/directions/set.h index 8ed73a5f3b..a7cdc7fb71 100644 --- a/src/dwi/directions/set.h +++ b/src/dwi/directions/set.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/fixel_map.h b/src/dwi/fixel_map.h index eb0d0174dd..a1f19a4712 100644 --- a/src/dwi/fixel_map.h +++ b/src/dwi/fixel_map.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/fmls.cpp b/src/dwi/fmls.cpp index 120ca4611f..12307405e5 100644 --- a/src/dwi/fmls.cpp +++ b/src/dwi/fmls.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/fmls.h b/src/dwi/fmls.h index f7dd72b207..764a9945ce 100644 --- a/src/dwi/fmls.h +++ b/src/dwi/fmls.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/gradient.cpp b/src/dwi/gradient.cpp index 40419b4212..f333ea8e90 100644 --- a/src/dwi/gradient.cpp +++ b/src/dwi/gradient.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/gradient.h b/src/dwi/gradient.h index a2c2a9a517..ae706a32b4 100644 --- a/src/dwi/gradient.h +++ b/src/dwi/gradient.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/noise_estimator.h b/src/dwi/noise_estimator.h index e99ced135e..fe1948ea04 100644 --- a/src/dwi/noise_estimator.h +++ b/src/dwi/noise_estimator.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/sdeconv/csd.cpp b/src/dwi/sdeconv/csd.cpp index 0b5d525a6c..56ddd167ab 100644 --- a/src/dwi/sdeconv/csd.cpp +++ b/src/dwi/sdeconv/csd.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/sdeconv/csd.h b/src/dwi/sdeconv/csd.h index 67ea8e01d8..43224200f8 100644 --- a/src/dwi/sdeconv/csd.h +++ b/src/dwi/sdeconv/csd.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/sdeconv/msmt_csd.h b/src/dwi/sdeconv/msmt_csd.h index ed3dadb55c..c8758f486e 100644 --- a/src/dwi/sdeconv/msmt_csd.h +++ b/src/dwi/sdeconv/msmt_csd.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/shells.cpp b/src/dwi/shells.cpp index e4cfa7dcc1..ddb6587031 100644 --- a/src/dwi/shells.cpp +++ b/src/dwi/shells.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/shells.h b/src/dwi/shells.h index b2d1ac3d9e..cada7c15be 100644 --- a/src/dwi/shells.h +++ b/src/dwi/shells.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tensor.h b/src/dwi/tensor.h index 5842d50b6e..e5c0800311 100644 --- a/src/dwi/tensor.h +++ b/src/dwi/tensor.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/ACT/act.cpp b/src/dwi/tractography/ACT/act.cpp index 8dd706b459..a0f4e91ad9 100644 --- a/src/dwi/tractography/ACT/act.cpp +++ b/src/dwi/tractography/ACT/act.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/ACT/act.h b/src/dwi/tractography/ACT/act.h index 26748c3174..60b2e397b8 100644 --- a/src/dwi/tractography/ACT/act.h +++ b/src/dwi/tractography/ACT/act.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/ACT/gmwmi.cpp b/src/dwi/tractography/ACT/gmwmi.cpp index 7e1b633089..f633072a67 100644 --- a/src/dwi/tractography/ACT/gmwmi.cpp +++ b/src/dwi/tractography/ACT/gmwmi.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/ACT/gmwmi.h b/src/dwi/tractography/ACT/gmwmi.h index 5cf82b1be7..b9f8b95a13 100644 --- a/src/dwi/tractography/ACT/gmwmi.h +++ b/src/dwi/tractography/ACT/gmwmi.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/ACT/method.h b/src/dwi/tractography/ACT/method.h index fd7653ecc0..9d98050f69 100644 --- a/src/dwi/tractography/ACT/method.h +++ b/src/dwi/tractography/ACT/method.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/ACT/shared.h b/src/dwi/tractography/ACT/shared.h index da74809f76..67725036f1 100644 --- a/src/dwi/tractography/ACT/shared.h +++ b/src/dwi/tractography/ACT/shared.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/ACT/tissues.h b/src/dwi/tractography/ACT/tissues.h index 01bc7dcb75..6ce2883172 100644 --- a/src/dwi/tractography/ACT/tissues.h +++ b/src/dwi/tractography/ACT/tissues.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/GT/energy.h b/src/dwi/tractography/GT/energy.h index 837e4ed486..24f4550d38 100644 --- a/src/dwi/tractography/GT/energy.h +++ b/src/dwi/tractography/GT/energy.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/GT/externalenergy.cpp b/src/dwi/tractography/GT/externalenergy.cpp index 5c80cc62e9..9273cf794f 100644 --- a/src/dwi/tractography/GT/externalenergy.cpp +++ b/src/dwi/tractography/GT/externalenergy.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/GT/externalenergy.h b/src/dwi/tractography/GT/externalenergy.h index f5d8456199..83484debdc 100644 --- a/src/dwi/tractography/GT/externalenergy.h +++ b/src/dwi/tractography/GT/externalenergy.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/GT/gt.cpp b/src/dwi/tractography/GT/gt.cpp index fdd4874c94..13196aae32 100644 --- a/src/dwi/tractography/GT/gt.cpp +++ b/src/dwi/tractography/GT/gt.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/GT/gt.h b/src/dwi/tractography/GT/gt.h index b026773587..d5b0ec004b 100644 --- a/src/dwi/tractography/GT/gt.h +++ b/src/dwi/tractography/GT/gt.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/GT/internalenergy.cpp b/src/dwi/tractography/GT/internalenergy.cpp index 04cef0f8e3..40a42f0b34 100644 --- a/src/dwi/tractography/GT/internalenergy.cpp +++ b/src/dwi/tractography/GT/internalenergy.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/GT/internalenergy.h b/src/dwi/tractography/GT/internalenergy.h index 105cf2f44c..859630874c 100644 --- a/src/dwi/tractography/GT/internalenergy.h +++ b/src/dwi/tractography/GT/internalenergy.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/GT/mhsampler.cpp b/src/dwi/tractography/GT/mhsampler.cpp index a686e8a022..f42a37d914 100644 --- a/src/dwi/tractography/GT/mhsampler.cpp +++ b/src/dwi/tractography/GT/mhsampler.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/GT/mhsampler.h b/src/dwi/tractography/GT/mhsampler.h index 365261227b..22f9285dd0 100644 --- a/src/dwi/tractography/GT/mhsampler.h +++ b/src/dwi/tractography/GT/mhsampler.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/GT/particle.cpp b/src/dwi/tractography/GT/particle.cpp index 2a02057c55..cb118b4a91 100644 --- a/src/dwi/tractography/GT/particle.cpp +++ b/src/dwi/tractography/GT/particle.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/GT/particle.h b/src/dwi/tractography/GT/particle.h index 2d39eeef5e..ca0bb52a5a 100644 --- a/src/dwi/tractography/GT/particle.h +++ b/src/dwi/tractography/GT/particle.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/GT/particlegrid.cpp b/src/dwi/tractography/GT/particlegrid.cpp index 6d41c7366b..b2e52b727d 100644 --- a/src/dwi/tractography/GT/particlegrid.cpp +++ b/src/dwi/tractography/GT/particlegrid.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/GT/particlegrid.h b/src/dwi/tractography/GT/particlegrid.h index afcef85f5f..78ee97c7df 100644 --- a/src/dwi/tractography/GT/particlegrid.h +++ b/src/dwi/tractography/GT/particlegrid.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/GT/particlepool.h b/src/dwi/tractography/GT/particlepool.h index 14fe5336dd..184efe1323 100644 --- a/src/dwi/tractography/GT/particlepool.h +++ b/src/dwi/tractography/GT/particlepool.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/GT/spatiallock.h b/src/dwi/tractography/GT/spatiallock.h index 255b8615a9..a0784847aa 100644 --- a/src/dwi/tractography/GT/spatiallock.h +++ b/src/dwi/tractography/GT/spatiallock.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT/fixel.h b/src/dwi/tractography/SIFT/fixel.h index c49ce9aa62..c55b9fda9d 100644 --- a/src/dwi/tractography/SIFT/fixel.h +++ b/src/dwi/tractography/SIFT/fixel.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT/gradient_sort.cpp b/src/dwi/tractography/SIFT/gradient_sort.cpp index b01ff8826a..b69994c807 100644 --- a/src/dwi/tractography/SIFT/gradient_sort.cpp +++ b/src/dwi/tractography/SIFT/gradient_sort.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT/gradient_sort.h b/src/dwi/tractography/SIFT/gradient_sort.h index d2a808e2d7..9598a7ba79 100644 --- a/src/dwi/tractography/SIFT/gradient_sort.h +++ b/src/dwi/tractography/SIFT/gradient_sort.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT/model.h b/src/dwi/tractography/SIFT/model.h index 79dd7c8433..02291133d2 100644 --- a/src/dwi/tractography/SIFT/model.h +++ b/src/dwi/tractography/SIFT/model.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT/model_base.h b/src/dwi/tractography/SIFT/model_base.h index 719a6a4975..660d7b6afe 100644 --- a/src/dwi/tractography/SIFT/model_base.h +++ b/src/dwi/tractography/SIFT/model_base.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT/output.h b/src/dwi/tractography/SIFT/output.h index 9898291201..4cdbe96644 100644 --- a/src/dwi/tractography/SIFT/output.h +++ b/src/dwi/tractography/SIFT/output.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT/proc_mask.cpp b/src/dwi/tractography/SIFT/proc_mask.cpp index 31d0d97c8d..da3ee7e91d 100644 --- a/src/dwi/tractography/SIFT/proc_mask.cpp +++ b/src/dwi/tractography/SIFT/proc_mask.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT/proc_mask.h b/src/dwi/tractography/SIFT/proc_mask.h index ac29ccec16..feb818b236 100644 --- a/src/dwi/tractography/SIFT/proc_mask.h +++ b/src/dwi/tractography/SIFT/proc_mask.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT/sift.cpp b/src/dwi/tractography/SIFT/sift.cpp index 9b76c65f9e..e02b55ffe5 100644 --- a/src/dwi/tractography/SIFT/sift.cpp +++ b/src/dwi/tractography/SIFT/sift.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT/sift.h b/src/dwi/tractography/SIFT/sift.h index e350ff840b..ec59884ca7 100644 --- a/src/dwi/tractography/SIFT/sift.h +++ b/src/dwi/tractography/SIFT/sift.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT/sifter.cpp b/src/dwi/tractography/SIFT/sifter.cpp index d1e6732b9d..ceb0b5526e 100644 --- a/src/dwi/tractography/SIFT/sifter.cpp +++ b/src/dwi/tractography/SIFT/sifter.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT/sifter.h b/src/dwi/tractography/SIFT/sifter.h index af365e77a7..874087de4f 100644 --- a/src/dwi/tractography/SIFT/sifter.h +++ b/src/dwi/tractography/SIFT/sifter.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT/track_contribution.cpp b/src/dwi/tractography/SIFT/track_contribution.cpp index 775e249151..4aa8287ea2 100644 --- a/src/dwi/tractography/SIFT/track_contribution.cpp +++ b/src/dwi/tractography/SIFT/track_contribution.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT/track_contribution.h b/src/dwi/tractography/SIFT/track_contribution.h index ac672a073c..5c02497ffe 100644 --- a/src/dwi/tractography/SIFT/track_contribution.h +++ b/src/dwi/tractography/SIFT/track_contribution.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT/track_index_range.cpp b/src/dwi/tractography/SIFT/track_index_range.cpp index 4cf3314fdc..26ffe3a8dd 100644 --- a/src/dwi/tractography/SIFT/track_index_range.cpp +++ b/src/dwi/tractography/SIFT/track_index_range.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT/track_index_range.h b/src/dwi/tractography/SIFT/track_index_range.h index dfcfdb4451..8adfc49644 100644 --- a/src/dwi/tractography/SIFT/track_index_range.h +++ b/src/dwi/tractography/SIFT/track_index_range.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT/types.h b/src/dwi/tractography/SIFT/types.h index 43714c333b..1a45eafb07 100644 --- a/src/dwi/tractography/SIFT/types.h +++ b/src/dwi/tractography/SIFT/types.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT2/coeff_optimiser.cpp b/src/dwi/tractography/SIFT2/coeff_optimiser.cpp index d2a5bcca4e..fb2583d854 100644 --- a/src/dwi/tractography/SIFT2/coeff_optimiser.cpp +++ b/src/dwi/tractography/SIFT2/coeff_optimiser.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT2/coeff_optimiser.h b/src/dwi/tractography/SIFT2/coeff_optimiser.h index 82ccc1d8e7..966b8585fa 100644 --- a/src/dwi/tractography/SIFT2/coeff_optimiser.h +++ b/src/dwi/tractography/SIFT2/coeff_optimiser.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT2/fixel.h b/src/dwi/tractography/SIFT2/fixel.h index 2d051cb44e..45a820ec9b 100644 --- a/src/dwi/tractography/SIFT2/fixel.h +++ b/src/dwi/tractography/SIFT2/fixel.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT2/fixel_updater.cpp b/src/dwi/tractography/SIFT2/fixel_updater.cpp index 09c6e83c57..430b6a1d4f 100644 --- a/src/dwi/tractography/SIFT2/fixel_updater.cpp +++ b/src/dwi/tractography/SIFT2/fixel_updater.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT2/fixel_updater.h b/src/dwi/tractography/SIFT2/fixel_updater.h index 6db1ec50c5..93784e622a 100644 --- a/src/dwi/tractography/SIFT2/fixel_updater.h +++ b/src/dwi/tractography/SIFT2/fixel_updater.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT2/line_search.cpp b/src/dwi/tractography/SIFT2/line_search.cpp index fd88108e35..736db31a89 100644 --- a/src/dwi/tractography/SIFT2/line_search.cpp +++ b/src/dwi/tractography/SIFT2/line_search.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT2/line_search.h b/src/dwi/tractography/SIFT2/line_search.h index 42e9b0aacb..d6e493263e 100644 --- a/src/dwi/tractography/SIFT2/line_search.h +++ b/src/dwi/tractography/SIFT2/line_search.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT2/reg_calculator.cpp b/src/dwi/tractography/SIFT2/reg_calculator.cpp index 9747d22927..ec7d1e56ff 100644 --- a/src/dwi/tractography/SIFT2/reg_calculator.cpp +++ b/src/dwi/tractography/SIFT2/reg_calculator.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT2/reg_calculator.h b/src/dwi/tractography/SIFT2/reg_calculator.h index 05ded48834..c68d82e12a 100644 --- a/src/dwi/tractography/SIFT2/reg_calculator.h +++ b/src/dwi/tractography/SIFT2/reg_calculator.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT2/regularisation.h b/src/dwi/tractography/SIFT2/regularisation.h index 49e7cd76f0..56139c2818 100644 --- a/src/dwi/tractography/SIFT2/regularisation.h +++ b/src/dwi/tractography/SIFT2/regularisation.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT2/streamline_stats.cpp b/src/dwi/tractography/SIFT2/streamline_stats.cpp index c04012496a..6a421f4a74 100644 --- a/src/dwi/tractography/SIFT2/streamline_stats.cpp +++ b/src/dwi/tractography/SIFT2/streamline_stats.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT2/streamline_stats.h b/src/dwi/tractography/SIFT2/streamline_stats.h index b2037be5e4..ff9667a5ae 100644 --- a/src/dwi/tractography/SIFT2/streamline_stats.h +++ b/src/dwi/tractography/SIFT2/streamline_stats.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT2/tckfactor.cpp b/src/dwi/tractography/SIFT2/tckfactor.cpp index bf037edcbb..998e0f035b 100644 --- a/src/dwi/tractography/SIFT2/tckfactor.cpp +++ b/src/dwi/tractography/SIFT2/tckfactor.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/SIFT2/tckfactor.h b/src/dwi/tractography/SIFT2/tckfactor.h index cdd612e9fd..edbb4344b0 100644 --- a/src/dwi/tractography/SIFT2/tckfactor.h +++ b/src/dwi/tractography/SIFT2/tckfactor.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/algorithms/calibrator.h b/src/dwi/tractography/algorithms/calibrator.h index 36e5b7149d..05bf5b32b4 100644 --- a/src/dwi/tractography/algorithms/calibrator.h +++ b/src/dwi/tractography/algorithms/calibrator.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/algorithms/fact.h b/src/dwi/tractography/algorithms/fact.h index c2af7d3185..2aef006b43 100644 --- a/src/dwi/tractography/algorithms/fact.h +++ b/src/dwi/tractography/algorithms/fact.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/algorithms/iFOD1.h b/src/dwi/tractography/algorithms/iFOD1.h index 6ed5e33781..2bfe04b3ad 100644 --- a/src/dwi/tractography/algorithms/iFOD1.h +++ b/src/dwi/tractography/algorithms/iFOD1.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/algorithms/iFOD2.cpp b/src/dwi/tractography/algorithms/iFOD2.cpp index c3abf21cb9..231293f103 100644 --- a/src/dwi/tractography/algorithms/iFOD2.cpp +++ b/src/dwi/tractography/algorithms/iFOD2.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/algorithms/iFOD2.h b/src/dwi/tractography/algorithms/iFOD2.h index c0aed44c6f..040f4b2b8d 100644 --- a/src/dwi/tractography/algorithms/iFOD2.h +++ b/src/dwi/tractography/algorithms/iFOD2.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/algorithms/nulldist.h b/src/dwi/tractography/algorithms/nulldist.h index 7db1e55978..0656ebb063 100644 --- a/src/dwi/tractography/algorithms/nulldist.h +++ b/src/dwi/tractography/algorithms/nulldist.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/algorithms/sd_stream.h b/src/dwi/tractography/algorithms/sd_stream.h index 8919f8555c..bf05261e37 100644 --- a/src/dwi/tractography/algorithms/sd_stream.h +++ b/src/dwi/tractography/algorithms/sd_stream.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/algorithms/seedtest.h b/src/dwi/tractography/algorithms/seedtest.h index c42545e906..8be9ef55e2 100644 --- a/src/dwi/tractography/algorithms/seedtest.h +++ b/src/dwi/tractography/algorithms/seedtest.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/algorithms/tensor_det.h b/src/dwi/tractography/algorithms/tensor_det.h index f444dcab7e..3f32cbf43b 100644 --- a/src/dwi/tractography/algorithms/tensor_det.h +++ b/src/dwi/tractography/algorithms/tensor_det.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/algorithms/tensor_prob.h b/src/dwi/tractography/algorithms/tensor_prob.h index ba40021b72..f3fb623b34 100644 --- a/src/dwi/tractography/algorithms/tensor_prob.h +++ b/src/dwi/tractography/algorithms/tensor_prob.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/connectome/connectome.cpp b/src/dwi/tractography/connectome/connectome.cpp index 5064f3d06f..fb797ac455 100644 --- a/src/dwi/tractography/connectome/connectome.cpp +++ b/src/dwi/tractography/connectome/connectome.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/connectome/connectome.h b/src/dwi/tractography/connectome/connectome.h index c55bb381af..a0d258b757 100644 --- a/src/dwi/tractography/connectome/connectome.h +++ b/src/dwi/tractography/connectome/connectome.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/connectome/exemplar.cpp b/src/dwi/tractography/connectome/exemplar.cpp index 28a779e117..cf9fbcd4be 100644 --- a/src/dwi/tractography/connectome/exemplar.cpp +++ b/src/dwi/tractography/connectome/exemplar.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/connectome/exemplar.h b/src/dwi/tractography/connectome/exemplar.h index a11094f120..0101b3e7cc 100644 --- a/src/dwi/tractography/connectome/exemplar.h +++ b/src/dwi/tractography/connectome/exemplar.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/connectome/extract.cpp b/src/dwi/tractography/connectome/extract.cpp index 4d6e676702..3dec975a95 100644 --- a/src/dwi/tractography/connectome/extract.cpp +++ b/src/dwi/tractography/connectome/extract.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/connectome/extract.h b/src/dwi/tractography/connectome/extract.h index 5f23c31714..d6e28a4939 100644 --- a/src/dwi/tractography/connectome/extract.h +++ b/src/dwi/tractography/connectome/extract.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/connectome/mapped_track.h b/src/dwi/tractography/connectome/mapped_track.h index 8269492d8e..d229fdf849 100644 --- a/src/dwi/tractography/connectome/mapped_track.h +++ b/src/dwi/tractography/connectome/mapped_track.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/connectome/mapper.h b/src/dwi/tractography/connectome/mapper.h index fb49c821df..61b717e85c 100644 --- a/src/dwi/tractography/connectome/mapper.h +++ b/src/dwi/tractography/connectome/mapper.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/connectome/matrix.cpp b/src/dwi/tractography/connectome/matrix.cpp index 7a740d6143..cf066dd616 100644 --- a/src/dwi/tractography/connectome/matrix.cpp +++ b/src/dwi/tractography/connectome/matrix.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/connectome/matrix.h b/src/dwi/tractography/connectome/matrix.h index d6a62dadbc..4fb1516d2c 100644 --- a/src/dwi/tractography/connectome/matrix.h +++ b/src/dwi/tractography/connectome/matrix.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/connectome/metric.h b/src/dwi/tractography/connectome/metric.h index c1f1c208d2..722ffc5983 100644 --- a/src/dwi/tractography/connectome/metric.h +++ b/src/dwi/tractography/connectome/metric.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/connectome/streamline.h b/src/dwi/tractography/connectome/streamline.h index 4a71ed09c8..ccab72820d 100644 --- a/src/dwi/tractography/connectome/streamline.h +++ b/src/dwi/tractography/connectome/streamline.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/connectome/tck2nodes.cpp b/src/dwi/tractography/connectome/tck2nodes.cpp index 8f93b7298a..56efc849b4 100644 --- a/src/dwi/tractography/connectome/tck2nodes.cpp +++ b/src/dwi/tractography/connectome/tck2nodes.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/connectome/tck2nodes.h b/src/dwi/tractography/connectome/tck2nodes.h index 03aee27730..a3810fd492 100644 --- a/src/dwi/tractography/connectome/tck2nodes.h +++ b/src/dwi/tractography/connectome/tck2nodes.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/editing/editing.cpp b/src/dwi/tractography/editing/editing.cpp index 332f89bc33..872e02a3f1 100644 --- a/src/dwi/tractography/editing/editing.cpp +++ b/src/dwi/tractography/editing/editing.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/editing/editing.h b/src/dwi/tractography/editing/editing.h index 77797e8e35..4833117b21 100644 --- a/src/dwi/tractography/editing/editing.h +++ b/src/dwi/tractography/editing/editing.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/editing/loader.h b/src/dwi/tractography/editing/loader.h index e9c29884ba..41234b11ba 100644 --- a/src/dwi/tractography/editing/loader.h +++ b/src/dwi/tractography/editing/loader.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/editing/receiver.cpp b/src/dwi/tractography/editing/receiver.cpp index bb8bc2eba3..84cb09d9a6 100644 --- a/src/dwi/tractography/editing/receiver.cpp +++ b/src/dwi/tractography/editing/receiver.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/editing/receiver.h b/src/dwi/tractography/editing/receiver.h index b16b699e56..ad991d54ee 100644 --- a/src/dwi/tractography/editing/receiver.h +++ b/src/dwi/tractography/editing/receiver.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/editing/worker.cpp b/src/dwi/tractography/editing/worker.cpp index e54be69706..57d42e7921 100644 --- a/src/dwi/tractography/editing/worker.cpp +++ b/src/dwi/tractography/editing/worker.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/editing/worker.h b/src/dwi/tractography/editing/worker.h index 0bb80c9b3f..29396f6f42 100644 --- a/src/dwi/tractography/editing/worker.h +++ b/src/dwi/tractography/editing/worker.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/file.h b/src/dwi/tractography/file.h index 461b4ab3b1..6035b7b2de 100644 --- a/src/dwi/tractography/file.h +++ b/src/dwi/tractography/file.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/file_base.cpp b/src/dwi/tractography/file_base.cpp index 3e28b9fc34..f0fb3505e1 100644 --- a/src/dwi/tractography/file_base.cpp +++ b/src/dwi/tractography/file_base.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/file_base.h b/src/dwi/tractography/file_base.h index 3eab897cdb..e3157cc276 100644 --- a/src/dwi/tractography/file_base.h +++ b/src/dwi/tractography/file_base.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/mapping/buffer_scratch_dump.h b/src/dwi/tractography/mapping/buffer_scratch_dump.h index f6de0a378c..7c5723ce8a 100644 --- a/src/dwi/tractography/mapping/buffer_scratch_dump.h +++ b/src/dwi/tractography/mapping/buffer_scratch_dump.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/mapping/fixel_td_map.cpp b/src/dwi/tractography/mapping/fixel_td_map.cpp index a8af89cd3a..05810bbe6a 100644 --- a/src/dwi/tractography/mapping/fixel_td_map.cpp +++ b/src/dwi/tractography/mapping/fixel_td_map.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/mapping/fixel_td_map.h b/src/dwi/tractography/mapping/fixel_td_map.h index c636876129..f189af4bbd 100644 --- a/src/dwi/tractography/mapping/fixel_td_map.h +++ b/src/dwi/tractography/mapping/fixel_td_map.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/mapping/gaussian/mapper.cpp b/src/dwi/tractography/mapping/gaussian/mapper.cpp index 4d85464dff..a8e864ada4 100644 --- a/src/dwi/tractography/mapping/gaussian/mapper.cpp +++ b/src/dwi/tractography/mapping/gaussian/mapper.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/mapping/gaussian/mapper.h b/src/dwi/tractography/mapping/gaussian/mapper.h index 3021f81c6d..e45c5fd0a4 100644 --- a/src/dwi/tractography/mapping/gaussian/mapper.h +++ b/src/dwi/tractography/mapping/gaussian/mapper.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/mapping/gaussian/voxel.h b/src/dwi/tractography/mapping/gaussian/voxel.h index 4b414a9f17..1c02302c58 100644 --- a/src/dwi/tractography/mapping/gaussian/voxel.h +++ b/src/dwi/tractography/mapping/gaussian/voxel.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/mapping/loader.h b/src/dwi/tractography/mapping/loader.h index f5f4d710ff..d978c131c8 100644 --- a/src/dwi/tractography/mapping/loader.h +++ b/src/dwi/tractography/mapping/loader.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/mapping/mapper.cpp b/src/dwi/tractography/mapping/mapper.cpp index a9de067ffb..44439d891a 100644 --- a/src/dwi/tractography/mapping/mapper.cpp +++ b/src/dwi/tractography/mapping/mapper.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/mapping/mapper.h b/src/dwi/tractography/mapping/mapper.h index 6cf8da2679..68d8438590 100644 --- a/src/dwi/tractography/mapping/mapper.h +++ b/src/dwi/tractography/mapping/mapper.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/mapping/mapper_plugins.cpp b/src/dwi/tractography/mapping/mapper_plugins.cpp index 05c469fcd1..4590030ead 100644 --- a/src/dwi/tractography/mapping/mapper_plugins.cpp +++ b/src/dwi/tractography/mapping/mapper_plugins.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/mapping/mapper_plugins.h b/src/dwi/tractography/mapping/mapper_plugins.h index ee260f2564..4f3ab647c8 100644 --- a/src/dwi/tractography/mapping/mapper_plugins.h +++ b/src/dwi/tractography/mapping/mapper_plugins.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/mapping/mapping.cpp b/src/dwi/tractography/mapping/mapping.cpp index 7e3481cc53..60fd2fa11e 100644 --- a/src/dwi/tractography/mapping/mapping.cpp +++ b/src/dwi/tractography/mapping/mapping.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/mapping/mapping.h b/src/dwi/tractography/mapping/mapping.h index a0d386e184..5bb50b8257 100644 --- a/src/dwi/tractography/mapping/mapping.h +++ b/src/dwi/tractography/mapping/mapping.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/mapping/twi_stats.cpp b/src/dwi/tractography/mapping/twi_stats.cpp index fa90a2a9bb..1e07ae1a5a 100644 --- a/src/dwi/tractography/mapping/twi_stats.cpp +++ b/src/dwi/tractography/mapping/twi_stats.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/mapping/twi_stats.h b/src/dwi/tractography/mapping/twi_stats.h index d33760f284..ab54d1729c 100644 --- a/src/dwi/tractography/mapping/twi_stats.h +++ b/src/dwi/tractography/mapping/twi_stats.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/mapping/voxel.cpp b/src/dwi/tractography/mapping/voxel.cpp index 7433aba2c7..b07694d261 100644 --- a/src/dwi/tractography/mapping/voxel.cpp +++ b/src/dwi/tractography/mapping/voxel.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/mapping/voxel.h b/src/dwi/tractography/mapping/voxel.h index c25a58da0f..7f8f800391 100644 --- a/src/dwi/tractography/mapping/voxel.h +++ b/src/dwi/tractography/mapping/voxel.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/mapping/writer.cpp b/src/dwi/tractography/mapping/writer.cpp index 355548136c..c2d6b0f71f 100644 --- a/src/dwi/tractography/mapping/writer.cpp +++ b/src/dwi/tractography/mapping/writer.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/mapping/writer.h b/src/dwi/tractography/mapping/writer.h index 0fcaf8b0f8..baf9902865 100644 --- a/src/dwi/tractography/mapping/writer.h +++ b/src/dwi/tractography/mapping/writer.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/properties.cpp b/src/dwi/tractography/properties.cpp index 5a63842897..10c26a30ea 100644 --- a/src/dwi/tractography/properties.cpp +++ b/src/dwi/tractography/properties.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/properties.h b/src/dwi/tractography/properties.h index 0a7c92e6ff..93d6015e56 100644 --- a/src/dwi/tractography/properties.h +++ b/src/dwi/tractography/properties.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/resampling/arc.cpp b/src/dwi/tractography/resampling/arc.cpp index 7c5addd2ce..25b06f09b6 100644 --- a/src/dwi/tractography/resampling/arc.cpp +++ b/src/dwi/tractography/resampling/arc.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/resampling/arc.h b/src/dwi/tractography/resampling/arc.h index f750a2927c..6656166441 100644 --- a/src/dwi/tractography/resampling/arc.h +++ b/src/dwi/tractography/resampling/arc.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/resampling/downsampler.cpp b/src/dwi/tractography/resampling/downsampler.cpp index 07e3a52b8b..d596b4ccc2 100644 --- a/src/dwi/tractography/resampling/downsampler.cpp +++ b/src/dwi/tractography/resampling/downsampler.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/resampling/downsampler.h b/src/dwi/tractography/resampling/downsampler.h index 64af49174b..fe6fc79515 100644 --- a/src/dwi/tractography/resampling/downsampler.h +++ b/src/dwi/tractography/resampling/downsampler.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/resampling/endpoints.cpp b/src/dwi/tractography/resampling/endpoints.cpp index 97121ebf7c..a2f81d7864 100644 --- a/src/dwi/tractography/resampling/endpoints.cpp +++ b/src/dwi/tractography/resampling/endpoints.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/resampling/endpoints.h b/src/dwi/tractography/resampling/endpoints.h index 04cb372569..187f56c771 100644 --- a/src/dwi/tractography/resampling/endpoints.h +++ b/src/dwi/tractography/resampling/endpoints.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/resampling/fixed_num_points.cpp b/src/dwi/tractography/resampling/fixed_num_points.cpp index 8fcca13752..8c35e6683d 100644 --- a/src/dwi/tractography/resampling/fixed_num_points.cpp +++ b/src/dwi/tractography/resampling/fixed_num_points.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/resampling/fixed_num_points.h b/src/dwi/tractography/resampling/fixed_num_points.h index d374a81feb..ddc135dd96 100644 --- a/src/dwi/tractography/resampling/fixed_num_points.h +++ b/src/dwi/tractography/resampling/fixed_num_points.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/resampling/fixed_step_size.cpp b/src/dwi/tractography/resampling/fixed_step_size.cpp index 5732275676..191e3ad1a6 100644 --- a/src/dwi/tractography/resampling/fixed_step_size.cpp +++ b/src/dwi/tractography/resampling/fixed_step_size.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/resampling/fixed_step_size.h b/src/dwi/tractography/resampling/fixed_step_size.h index 339bb2c6cc..12b01f50f3 100644 --- a/src/dwi/tractography/resampling/fixed_step_size.h +++ b/src/dwi/tractography/resampling/fixed_step_size.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/resampling/resampling.cpp b/src/dwi/tractography/resampling/resampling.cpp index 9a47839fea..d8a13b0ada 100644 --- a/src/dwi/tractography/resampling/resampling.cpp +++ b/src/dwi/tractography/resampling/resampling.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/resampling/resampling.h b/src/dwi/tractography/resampling/resampling.h index 3d82e4a840..356b87295c 100644 --- a/src/dwi/tractography/resampling/resampling.h +++ b/src/dwi/tractography/resampling/resampling.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/resampling/upsampler.cpp b/src/dwi/tractography/resampling/upsampler.cpp index c6f2d91d96..024df841b3 100644 --- a/src/dwi/tractography/resampling/upsampler.cpp +++ b/src/dwi/tractography/resampling/upsampler.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/resampling/upsampler.h b/src/dwi/tractography/resampling/upsampler.h index c7734ec159..aaa2a4695f 100644 --- a/src/dwi/tractography/resampling/upsampler.h +++ b/src/dwi/tractography/resampling/upsampler.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/rng.cpp b/src/dwi/tractography/rng.cpp index f5a32e50e6..67d833dd1e 100644 --- a/src/dwi/tractography/rng.cpp +++ b/src/dwi/tractography/rng.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/rng.h b/src/dwi/tractography/rng.h index c5f85cfb3c..e32592e03c 100644 --- a/src/dwi/tractography/rng.h +++ b/src/dwi/tractography/rng.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/roi.cpp b/src/dwi/tractography/roi.cpp index 5379676e66..c604f23e04 100644 --- a/src/dwi/tractography/roi.cpp +++ b/src/dwi/tractography/roi.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/roi.h b/src/dwi/tractography/roi.h index 3e994dbdcc..fd89e759c4 100644 --- a/src/dwi/tractography/roi.h +++ b/src/dwi/tractography/roi.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/scalar_file.h b/src/dwi/tractography/scalar_file.h index 763ef14848..67eb7beffc 100644 --- a/src/dwi/tractography/scalar_file.h +++ b/src/dwi/tractography/scalar_file.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/seeding/base.h b/src/dwi/tractography/seeding/base.h index 106aa198e7..c689dc2980 100644 --- a/src/dwi/tractography/seeding/base.h +++ b/src/dwi/tractography/seeding/base.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/seeding/basic.cpp b/src/dwi/tractography/seeding/basic.cpp index 27d34c4da0..4c63b94520 100644 --- a/src/dwi/tractography/seeding/basic.cpp +++ b/src/dwi/tractography/seeding/basic.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/seeding/basic.h b/src/dwi/tractography/seeding/basic.h index c95dbdb92d..e04b228e49 100644 --- a/src/dwi/tractography/seeding/basic.h +++ b/src/dwi/tractography/seeding/basic.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/seeding/dynamic.cpp b/src/dwi/tractography/seeding/dynamic.cpp index 1ccff8d777..a416315c86 100644 --- a/src/dwi/tractography/seeding/dynamic.cpp +++ b/src/dwi/tractography/seeding/dynamic.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/seeding/dynamic.h b/src/dwi/tractography/seeding/dynamic.h index 06bf97a6b1..dbd8b6fe71 100644 --- a/src/dwi/tractography/seeding/dynamic.h +++ b/src/dwi/tractography/seeding/dynamic.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/seeding/gmwmi.cpp b/src/dwi/tractography/seeding/gmwmi.cpp index bb3490bdbd..5cea619855 100644 --- a/src/dwi/tractography/seeding/gmwmi.cpp +++ b/src/dwi/tractography/seeding/gmwmi.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/seeding/gmwmi.h b/src/dwi/tractography/seeding/gmwmi.h index 3b3b7ad4cd..35b23f02d4 100644 --- a/src/dwi/tractography/seeding/gmwmi.h +++ b/src/dwi/tractography/seeding/gmwmi.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/seeding/list.cpp b/src/dwi/tractography/seeding/list.cpp index 5370749b5f..2ebbe6cc85 100644 --- a/src/dwi/tractography/seeding/list.cpp +++ b/src/dwi/tractography/seeding/list.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/seeding/list.h b/src/dwi/tractography/seeding/list.h index f5de9b7c1d..466ff6e23f 100644 --- a/src/dwi/tractography/seeding/list.h +++ b/src/dwi/tractography/seeding/list.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/seeding/seeding.cpp b/src/dwi/tractography/seeding/seeding.cpp index 889f847116..c60bf40d37 100644 --- a/src/dwi/tractography/seeding/seeding.cpp +++ b/src/dwi/tractography/seeding/seeding.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/seeding/seeding.h b/src/dwi/tractography/seeding/seeding.h index 2fd73673a2..f87b068a91 100644 --- a/src/dwi/tractography/seeding/seeding.h +++ b/src/dwi/tractography/seeding/seeding.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/streamline.h b/src/dwi/tractography/streamline.h index 6b0d2c5602..f77455179a 100644 --- a/src/dwi/tractography/streamline.h +++ b/src/dwi/tractography/streamline.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/tracking/early_exit.cpp b/src/dwi/tractography/tracking/early_exit.cpp index 184bc17905..b08a016754 100644 --- a/src/dwi/tractography/tracking/early_exit.cpp +++ b/src/dwi/tractography/tracking/early_exit.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/tracking/early_exit.h b/src/dwi/tractography/tracking/early_exit.h index 659e67a242..a9fc3e5e6a 100644 --- a/src/dwi/tractography/tracking/early_exit.h +++ b/src/dwi/tractography/tracking/early_exit.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/tracking/exec.h b/src/dwi/tractography/tracking/exec.h index 2762f2b75b..df3ccc5be9 100644 --- a/src/dwi/tractography/tracking/exec.h +++ b/src/dwi/tractography/tracking/exec.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/tracking/generated_track.h b/src/dwi/tractography/tracking/generated_track.h index 46a9ae3c93..96c7e326c4 100644 --- a/src/dwi/tractography/tracking/generated_track.h +++ b/src/dwi/tractography/tracking/generated_track.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/tracking/method.cpp b/src/dwi/tractography/tracking/method.cpp index 9bfa521ab1..295ef17e08 100644 --- a/src/dwi/tractography/tracking/method.cpp +++ b/src/dwi/tractography/tracking/method.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/tracking/method.h b/src/dwi/tractography/tracking/method.h index 5dc0a123d0..e19fa3a1d9 100644 --- a/src/dwi/tractography/tracking/method.h +++ b/src/dwi/tractography/tracking/method.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/tracking/shared.cpp b/src/dwi/tractography/tracking/shared.cpp index 7e3366154a..47a5fa56f0 100644 --- a/src/dwi/tractography/tracking/shared.cpp +++ b/src/dwi/tractography/tracking/shared.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/tracking/shared.h b/src/dwi/tractography/tracking/shared.h index eac9524318..b518f3a4dd 100644 --- a/src/dwi/tractography/tracking/shared.h +++ b/src/dwi/tractography/tracking/shared.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/tracking/tractography.cpp b/src/dwi/tractography/tracking/tractography.cpp index 51a60d63dc..e04d1b8af2 100644 --- a/src/dwi/tractography/tracking/tractography.cpp +++ b/src/dwi/tractography/tracking/tractography.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/tracking/tractography.h b/src/dwi/tractography/tracking/tractography.h index e8a509ea72..0f8f2802bc 100644 --- a/src/dwi/tractography/tracking/tractography.h +++ b/src/dwi/tractography/tracking/tractography.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/tracking/types.h b/src/dwi/tractography/tracking/types.h index 77fb3e8a43..fff67372a1 100644 --- a/src/dwi/tractography/tracking/types.h +++ b/src/dwi/tractography/tracking/types.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/tracking/write_kernel.cpp b/src/dwi/tractography/tracking/write_kernel.cpp index 7260aafaee..01327eed23 100644 --- a/src/dwi/tractography/tracking/write_kernel.cpp +++ b/src/dwi/tractography/tracking/write_kernel.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/tracking/write_kernel.h b/src/dwi/tractography/tracking/write_kernel.h index f693ccb00f..3615d62e1b 100644 --- a/src/dwi/tractography/tracking/write_kernel.h +++ b/src/dwi/tractography/tracking/write_kernel.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/weights.cpp b/src/dwi/tractography/weights.cpp index 7f1d416ac3..7f24da0ce5 100644 --- a/src/dwi/tractography/weights.cpp +++ b/src/dwi/tractography/weights.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/dwi/tractography/weights.h b/src/dwi/tractography/weights.h index 625148cdca..7935194d95 100644 --- a/src/dwi/tractography/weights.h +++ b/src/dwi/tractography/weights.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/color_button.cpp b/src/gui/color_button.cpp index 3bd6170821..d9a28e103a 100644 --- a/src/gui/color_button.cpp +++ b/src/gui/color_button.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/color_button.h b/src/gui/color_button.h index d7a802899a..bfc0bff58f 100644 --- a/src/gui/color_button.h +++ b/src/gui/color_button.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/cursor.cpp b/src/gui/cursor.cpp index fca09613fa..14b9a2495e 100644 --- a/src/gui/cursor.cpp +++ b/src/gui/cursor.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/cursor.h b/src/gui/cursor.h index e0f613c427..bfe07ff236 100644 --- a/src/gui/cursor.h +++ b/src/gui/cursor.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dialog/dialog.cpp b/src/gui/dialog/dialog.cpp index c75dbebea8..01c277ecd8 100644 --- a/src/gui/dialog/dialog.cpp +++ b/src/gui/dialog/dialog.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dialog/dialog.h b/src/gui/dialog/dialog.h index 5cdae24f6a..db01db5ee0 100644 --- a/src/gui/dialog/dialog.h +++ b/src/gui/dialog/dialog.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dialog/dicom.cpp b/src/gui/dialog/dicom.cpp index a8c794afce..f8a50886c7 100644 --- a/src/gui/dialog/dicom.cpp +++ b/src/gui/dialog/dicom.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dialog/dicom.h b/src/gui/dialog/dicom.h index 988368b244..3a3b191138 100644 --- a/src/gui/dialog/dicom.h +++ b/src/gui/dialog/dicom.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dialog/file.cpp b/src/gui/dialog/file.cpp index 39ca0f0758..f8622c2eaf 100644 --- a/src/gui/dialog/file.cpp +++ b/src/gui/dialog/file.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dialog/file.h b/src/gui/dialog/file.h index a81c4ede16..c88077a8be 100644 --- a/src/gui/dialog/file.h +++ b/src/gui/dialog/file.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dialog/image_properties.cpp b/src/gui/dialog/image_properties.cpp index b67ce67202..658f564460 100644 --- a/src/gui/dialog/image_properties.cpp +++ b/src/gui/dialog/image_properties.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dialog/image_properties.h b/src/gui/dialog/image_properties.h index 07ed37ab07..5328982b97 100644 --- a/src/gui/dialog/image_properties.h +++ b/src/gui/dialog/image_properties.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dialog/list.cpp b/src/gui/dialog/list.cpp index 8b5f1a1079..ffcf1b4396 100644 --- a/src/gui/dialog/list.cpp +++ b/src/gui/dialog/list.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dialog/list.h b/src/gui/dialog/list.h index e892c106db..88edc36821 100644 --- a/src/gui/dialog/list.h +++ b/src/gui/dialog/list.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dialog/opengl.cpp b/src/gui/dialog/opengl.cpp index 0366965e64..756b1056ef 100644 --- a/src/gui/dialog/opengl.cpp +++ b/src/gui/dialog/opengl.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dialog/opengl.h b/src/gui/dialog/opengl.h index 61f262f092..2bf7e00052 100644 --- a/src/gui/dialog/opengl.h +++ b/src/gui/dialog/opengl.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dialog/progress.cpp b/src/gui/dialog/progress.cpp index b826709072..d38b4e6284 100644 --- a/src/gui/dialog/progress.cpp +++ b/src/gui/dialog/progress.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dialog/progress.h b/src/gui/dialog/progress.h index 34c60ef7a7..9f225ff736 100644 --- a/src/gui/dialog/progress.h +++ b/src/gui/dialog/progress.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dialog/report_exception.cpp b/src/gui/dialog/report_exception.cpp index b63156f163..2c5f6a9ce8 100644 --- a/src/gui/dialog/report_exception.cpp +++ b/src/gui/dialog/report_exception.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dialog/report_exception.h b/src/gui/dialog/report_exception.h index 2abf2d5b86..036c70c4b5 100644 --- a/src/gui/dialog/report_exception.h +++ b/src/gui/dialog/report_exception.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dwi/render_frame.cpp b/src/gui/dwi/render_frame.cpp index 2dd6c18402..9915496dd9 100644 --- a/src/gui/dwi/render_frame.cpp +++ b/src/gui/dwi/render_frame.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dwi/render_frame.h b/src/gui/dwi/render_frame.h index bd098adde8..6943c72f4a 100644 --- a/src/gui/dwi/render_frame.h +++ b/src/gui/dwi/render_frame.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dwi/renderer.cpp b/src/gui/dwi/renderer.cpp index 6ab35bbf98..485c087406 100644 --- a/src/gui/dwi/renderer.cpp +++ b/src/gui/dwi/renderer.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/dwi/renderer.h b/src/gui/dwi/renderer.h index f17f4f1429..d3b3c94d9f 100644 --- a/src/gui/dwi/renderer.h +++ b/src/gui/dwi/renderer.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index a26ba385a8..8c8f4c9618 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/gui.h b/src/gui/gui.h index e3ee85fafd..b32db16704 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/lighting_dock.cpp b/src/gui/lighting_dock.cpp index c3074ab80a..6b654be830 100644 --- a/src/gui/lighting_dock.cpp +++ b/src/gui/lighting_dock.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/lighting_dock.h b/src/gui/lighting_dock.h index c83b128e5d..a8393b0ee4 100644 --- a/src/gui/lighting_dock.h +++ b/src/gui/lighting_dock.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/adjust_button.cpp b/src/gui/mrview/adjust_button.cpp index 7ee4793c00..c246ec2994 100644 --- a/src/gui/mrview/adjust_button.cpp +++ b/src/gui/mrview/adjust_button.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/adjust_button.h b/src/gui/mrview/adjust_button.h index faae0ad1c0..e1bba13782 100644 --- a/src/gui/mrview/adjust_button.h +++ b/src/gui/mrview/adjust_button.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/colourmap.cpp b/src/gui/mrview/colourmap.cpp index aa0c3b8007..163ca6cfb6 100644 --- a/src/gui/mrview/colourmap.cpp +++ b/src/gui/mrview/colourmap.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/colourmap.h b/src/gui/mrview/colourmap.h index 977cf5acc5..ecc9097589 100644 --- a/src/gui/mrview/colourmap.h +++ b/src/gui/mrview/colourmap.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/colourmap_button.cpp b/src/gui/mrview/colourmap_button.cpp index d46c83bdc6..faf68625d7 100644 --- a/src/gui/mrview/colourmap_button.cpp +++ b/src/gui/mrview/colourmap_button.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/colourmap_button.h b/src/gui/mrview/colourmap_button.h index 7194f95b8f..148aa7d4f8 100644 --- a/src/gui/mrview/colourmap_button.h +++ b/src/gui/mrview/colourmap_button.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/combo_box_error.cpp b/src/gui/mrview/combo_box_error.cpp index 64b714837e..791a2dd665 100644 --- a/src/gui/mrview/combo_box_error.cpp +++ b/src/gui/mrview/combo_box_error.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/combo_box_error.h b/src/gui/mrview/combo_box_error.h index f113af4dc6..7d351487ff 100644 --- a/src/gui/mrview/combo_box_error.h +++ b/src/gui/mrview/combo_box_error.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/displayable.cpp b/src/gui/mrview/displayable.cpp index a53dff3082..93d246d608 100644 --- a/src/gui/mrview/displayable.cpp +++ b/src/gui/mrview/displayable.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/displayable.h b/src/gui/mrview/displayable.h index 7460bcdb53..47e83d555a 100644 --- a/src/gui/mrview/displayable.h +++ b/src/gui/mrview/displayable.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/gui_image.cpp b/src/gui/mrview/gui_image.cpp index 4889cdbcb0..22e87db7b0 100644 --- a/src/gui/mrview/gui_image.cpp +++ b/src/gui/mrview/gui_image.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/gui_image.h b/src/gui/mrview/gui_image.h index 6cba1f1552..9b8b8e4f81 100644 --- a/src/gui/mrview/gui_image.h +++ b/src/gui/mrview/gui_image.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/icons.h b/src/gui/mrview/icons.h index 28ff20cb63..30efcac42a 100644 --- a/src/gui/mrview/icons.h +++ b/src/gui/mrview/icons.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/mode/base.cpp b/src/gui/mrview/mode/base.cpp index 2709e2d26a..4274604e74 100644 --- a/src/gui/mrview/mode/base.cpp +++ b/src/gui/mrview/mode/base.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/mode/base.h b/src/gui/mrview/mode/base.h index e40c3e1d6b..ccb44f1895 100644 --- a/src/gui/mrview/mode/base.h +++ b/src/gui/mrview/mode/base.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/mode/lightbox.cpp b/src/gui/mrview/mode/lightbox.cpp index 3f4fafdd0f..31dc48cea5 100644 --- a/src/gui/mrview/mode/lightbox.cpp +++ b/src/gui/mrview/mode/lightbox.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/mode/lightbox.h b/src/gui/mrview/mode/lightbox.h index 277ec7388d..9d380eba60 100644 --- a/src/gui/mrview/mode/lightbox.h +++ b/src/gui/mrview/mode/lightbox.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/mode/lightbox_gui.h b/src/gui/mrview/mode/lightbox_gui.h index be5b5ceb14..233f64b47d 100644 --- a/src/gui/mrview/mode/lightbox_gui.h +++ b/src/gui/mrview/mode/lightbox_gui.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/mode/list.h b/src/gui/mrview/mode/list.h index 1eddf007f3..84b91b1658 100644 --- a/src/gui/mrview/mode/list.h +++ b/src/gui/mrview/mode/list.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/mode/ortho.cpp b/src/gui/mrview/mode/ortho.cpp index 25c1464620..0913f74875 100644 --- a/src/gui/mrview/mode/ortho.cpp +++ b/src/gui/mrview/mode/ortho.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/mode/ortho.h b/src/gui/mrview/mode/ortho.h index 8b7af7d1cb..c0218e05ab 100644 --- a/src/gui/mrview/mode/ortho.h +++ b/src/gui/mrview/mode/ortho.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/mode/slice.cpp b/src/gui/mrview/mode/slice.cpp index ee435ce813..dfeea488ea 100644 --- a/src/gui/mrview/mode/slice.cpp +++ b/src/gui/mrview/mode/slice.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/mode/slice.h b/src/gui/mrview/mode/slice.h index c6e5d88982..7d2309c41d 100644 --- a/src/gui/mrview/mode/slice.h +++ b/src/gui/mrview/mode/slice.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/mode/volume.cpp b/src/gui/mrview/mode/volume.cpp index a9189e3e11..036ee3c751 100644 --- a/src/gui/mrview/mode/volume.cpp +++ b/src/gui/mrview/mode/volume.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/mode/volume.h b/src/gui/mrview/mode/volume.h index 8c0b2e88cd..6da70679db 100644 --- a/src/gui/mrview/mode/volume.h +++ b/src/gui/mrview/mode/volume.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/spin_box.h b/src/gui/mrview/spin_box.h index f3cfc3aa45..be967fb6cd 100644 --- a/src/gui/mrview/spin_box.h +++ b/src/gui/mrview/spin_box.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/base.cpp b/src/gui/mrview/tool/base.cpp index 9d967edeaf..6cc1b1aec5 100644 --- a/src/gui/mrview/tool/base.cpp +++ b/src/gui/mrview/tool/base.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/base.h b/src/gui/mrview/tool/base.h index 7868291155..39272bb72a 100644 --- a/src/gui/mrview/tool/base.h +++ b/src/gui/mrview/tool/base.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/colourmap_observers.cpp b/src/gui/mrview/tool/connectome/colourmap_observers.cpp index 7d8b9924c2..c80b9a669d 100644 --- a/src/gui/mrview/tool/connectome/colourmap_observers.cpp +++ b/src/gui/mrview/tool/connectome/colourmap_observers.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/colourmap_observers.h b/src/gui/mrview/tool/connectome/colourmap_observers.h index 250bf5cad6..b5210fe0cc 100644 --- a/src/gui/mrview/tool/connectome/colourmap_observers.h +++ b/src/gui/mrview/tool/connectome/colourmap_observers.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/connectome.cpp b/src/gui/mrview/tool/connectome/connectome.cpp index 1c8a0c6472..395696ac30 100644 --- a/src/gui/mrview/tool/connectome/connectome.cpp +++ b/src/gui/mrview/tool/connectome/connectome.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/connectome.h b/src/gui/mrview/tool/connectome/connectome.h index 957f5ecd3e..4009df577c 100644 --- a/src/gui/mrview/tool/connectome/connectome.h +++ b/src/gui/mrview/tool/connectome/connectome.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/edge.cpp b/src/gui/mrview/tool/connectome/edge.cpp index 068af7fd3b..2004878016 100644 --- a/src/gui/mrview/tool/connectome/edge.cpp +++ b/src/gui/mrview/tool/connectome/edge.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/edge.h b/src/gui/mrview/tool/connectome/edge.h index 7dacfe40df..2fa014a6f3 100644 --- a/src/gui/mrview/tool/connectome/edge.h +++ b/src/gui/mrview/tool/connectome/edge.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/file_data_vector.cpp b/src/gui/mrview/tool/connectome/file_data_vector.cpp index c4f21c5161..c829a0f632 100644 --- a/src/gui/mrview/tool/connectome/file_data_vector.cpp +++ b/src/gui/mrview/tool/connectome/file_data_vector.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/file_data_vector.h b/src/gui/mrview/tool/connectome/file_data_vector.h index 3a1542b554..2b3746792c 100644 --- a/src/gui/mrview/tool/connectome/file_data_vector.h +++ b/src/gui/mrview/tool/connectome/file_data_vector.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/matrix_list.cpp b/src/gui/mrview/tool/connectome/matrix_list.cpp index d5e35b756a..63454a870e 100644 --- a/src/gui/mrview/tool/connectome/matrix_list.cpp +++ b/src/gui/mrview/tool/connectome/matrix_list.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/matrix_list.h b/src/gui/mrview/tool/connectome/matrix_list.h index 571df99303..517b9b39cc 100644 --- a/src/gui/mrview/tool/connectome/matrix_list.h +++ b/src/gui/mrview/tool/connectome/matrix_list.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/node.cpp b/src/gui/mrview/tool/connectome/node.cpp index 2d3f097e5e..bc045c1b46 100644 --- a/src/gui/mrview/tool/connectome/node.cpp +++ b/src/gui/mrview/tool/connectome/node.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/node.h b/src/gui/mrview/tool/connectome/node.h index 0c0daa9ffb..b3d49d8d21 100644 --- a/src/gui/mrview/tool/connectome/node.h +++ b/src/gui/mrview/tool/connectome/node.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/node_list.cpp b/src/gui/mrview/tool/connectome/node_list.cpp index c56b1046b3..29be3718a6 100644 --- a/src/gui/mrview/tool/connectome/node_list.cpp +++ b/src/gui/mrview/tool/connectome/node_list.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/node_list.h b/src/gui/mrview/tool/connectome/node_list.h index 706573393b..89e1868fd1 100644 --- a/src/gui/mrview/tool/connectome/node_list.h +++ b/src/gui/mrview/tool/connectome/node_list.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/node_overlay.cpp b/src/gui/mrview/tool/connectome/node_overlay.cpp index d2c6935dcf..251379d76c 100644 --- a/src/gui/mrview/tool/connectome/node_overlay.cpp +++ b/src/gui/mrview/tool/connectome/node_overlay.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/node_overlay.h b/src/gui/mrview/tool/connectome/node_overlay.h index 359db9c8be..3af42711fe 100644 --- a/src/gui/mrview/tool/connectome/node_overlay.h +++ b/src/gui/mrview/tool/connectome/node_overlay.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/selection.cpp b/src/gui/mrview/tool/connectome/selection.cpp index db70b84d0e..507495354c 100644 --- a/src/gui/mrview/tool/connectome/selection.cpp +++ b/src/gui/mrview/tool/connectome/selection.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/selection.h b/src/gui/mrview/tool/connectome/selection.h index 3a6874bb09..dd0edc5fe2 100644 --- a/src/gui/mrview/tool/connectome/selection.h +++ b/src/gui/mrview/tool/connectome/selection.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/shaders.cpp b/src/gui/mrview/tool/connectome/shaders.cpp index 2277a60e35..a48eac7f1a 100644 --- a/src/gui/mrview/tool/connectome/shaders.cpp +++ b/src/gui/mrview/tool/connectome/shaders.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/shaders.h b/src/gui/mrview/tool/connectome/shaders.h index 628a718317..a76083cd0d 100644 --- a/src/gui/mrview/tool/connectome/shaders.h +++ b/src/gui/mrview/tool/connectome/shaders.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/connectome/types.h b/src/gui/mrview/tool/connectome/types.h index 58f3e1b7ca..9e4b8d5147 100644 --- a/src/gui/mrview/tool/connectome/types.h +++ b/src/gui/mrview/tool/connectome/types.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/fixel/base_fixel.cpp b/src/gui/mrview/tool/fixel/base_fixel.cpp index a21333dae5..60ab88e9c6 100644 --- a/src/gui/mrview/tool/fixel/base_fixel.cpp +++ b/src/gui/mrview/tool/fixel/base_fixel.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/fixel/base_fixel.h b/src/gui/mrview/tool/fixel/base_fixel.h index 817056a0d8..6516fd73ab 100644 --- a/src/gui/mrview/tool/fixel/base_fixel.h +++ b/src/gui/mrview/tool/fixel/base_fixel.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/fixel/directory.cpp b/src/gui/mrview/tool/fixel/directory.cpp index abcb1be5f4..8d61e8e4b4 100644 --- a/src/gui/mrview/tool/fixel/directory.cpp +++ b/src/gui/mrview/tool/fixel/directory.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/fixel/directory.h b/src/gui/mrview/tool/fixel/directory.h index 6576225fd9..fb39161d78 100644 --- a/src/gui/mrview/tool/fixel/directory.h +++ b/src/gui/mrview/tool/fixel/directory.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/fixel/fixel.cpp b/src/gui/mrview/tool/fixel/fixel.cpp index 10e7141aca..bb0d427cb1 100644 --- a/src/gui/mrview/tool/fixel/fixel.cpp +++ b/src/gui/mrview/tool/fixel/fixel.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/fixel/fixel.h b/src/gui/mrview/tool/fixel/fixel.h index c95ffa38e6..20b2214e08 100644 --- a/src/gui/mrview/tool/fixel/fixel.h +++ b/src/gui/mrview/tool/fixel/fixel.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/fixel/image4D.cpp b/src/gui/mrview/tool/fixel/image4D.cpp index 56f075dbbb..45181577ae 100644 --- a/src/gui/mrview/tool/fixel/image4D.cpp +++ b/src/gui/mrview/tool/fixel/image4D.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/fixel/image4D.h b/src/gui/mrview/tool/fixel/image4D.h index 712c04fc41..d769eebf7b 100644 --- a/src/gui/mrview/tool/fixel/image4D.h +++ b/src/gui/mrview/tool/fixel/image4D.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/fixel/legacy.cpp b/src/gui/mrview/tool/fixel/legacy.cpp index 38af8bddf6..400a9f44c6 100644 --- a/src/gui/mrview/tool/fixel/legacy.cpp +++ b/src/gui/mrview/tool/fixel/legacy.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/fixel/legacy.h b/src/gui/mrview/tool/fixel/legacy.h index 3015fb4fa0..6db89a8ed5 100644 --- a/src/gui/mrview/tool/fixel/legacy.h +++ b/src/gui/mrview/tool/fixel/legacy.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/fixel/vector_structs.h b/src/gui/mrview/tool/fixel/vector_structs.h index bb5c2c0fea..d2bb2c61bc 100644 --- a/src/gui/mrview/tool/fixel/vector_structs.h +++ b/src/gui/mrview/tool/fixel/vector_structs.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/list.h b/src/gui/mrview/tool/list.h index 2f3936dce7..fd7d421be1 100644 --- a/src/gui/mrview/tool/list.h +++ b/src/gui/mrview/tool/list.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/list_model_base.h b/src/gui/mrview/tool/list_model_base.h index 2e9cf58b25..04f5769479 100644 --- a/src/gui/mrview/tool/list_model_base.h +++ b/src/gui/mrview/tool/list_model_base.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/odf/item.cpp b/src/gui/mrview/tool/odf/item.cpp index 45827cf338..b8930b87a1 100644 --- a/src/gui/mrview/tool/odf/item.cpp +++ b/src/gui/mrview/tool/odf/item.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/odf/item.h b/src/gui/mrview/tool/odf/item.h index 02ec783fb5..d6a891f39e 100644 --- a/src/gui/mrview/tool/odf/item.h +++ b/src/gui/mrview/tool/odf/item.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/odf/model.cpp b/src/gui/mrview/tool/odf/model.cpp index f985dd1cda..50ffc0cc87 100644 --- a/src/gui/mrview/tool/odf/model.cpp +++ b/src/gui/mrview/tool/odf/model.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/odf/model.h b/src/gui/mrview/tool/odf/model.h index 8bd721bb03..d3da6e0d4b 100644 --- a/src/gui/mrview/tool/odf/model.h +++ b/src/gui/mrview/tool/odf/model.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/odf/odf.cpp b/src/gui/mrview/tool/odf/odf.cpp index 7f9398c93a..0dc7437528 100644 --- a/src/gui/mrview/tool/odf/odf.cpp +++ b/src/gui/mrview/tool/odf/odf.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/odf/odf.h b/src/gui/mrview/tool/odf/odf.h index 092aee9885..ff94d23816 100644 --- a/src/gui/mrview/tool/odf/odf.h +++ b/src/gui/mrview/tool/odf/odf.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/odf/preview.cpp b/src/gui/mrview/tool/odf/preview.cpp index 5e4bde7940..cbb3320bcf 100644 --- a/src/gui/mrview/tool/odf/preview.cpp +++ b/src/gui/mrview/tool/odf/preview.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/odf/preview.h b/src/gui/mrview/tool/odf/preview.h index 44454cf32f..1d2dc97588 100644 --- a/src/gui/mrview/tool/odf/preview.h +++ b/src/gui/mrview/tool/odf/preview.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/odf/type.h b/src/gui/mrview/tool/odf/type.h index cfecc499ac..8994d647d5 100644 --- a/src/gui/mrview/tool/odf/type.h +++ b/src/gui/mrview/tool/odf/type.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/overlay.cpp b/src/gui/mrview/tool/overlay.cpp index 15a85ca2ec..6f6f758fb0 100644 --- a/src/gui/mrview/tool/overlay.cpp +++ b/src/gui/mrview/tool/overlay.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/overlay.h b/src/gui/mrview/tool/overlay.h index de3878c154..aab99cf8c1 100644 --- a/src/gui/mrview/tool/overlay.h +++ b/src/gui/mrview/tool/overlay.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/roi_editor/item.cpp b/src/gui/mrview/tool/roi_editor/item.cpp index df60e20417..90b13b6edf 100644 --- a/src/gui/mrview/tool/roi_editor/item.cpp +++ b/src/gui/mrview/tool/roi_editor/item.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/roi_editor/item.h b/src/gui/mrview/tool/roi_editor/item.h index bd6e7914c7..d889a87fbf 100644 --- a/src/gui/mrview/tool/roi_editor/item.h +++ b/src/gui/mrview/tool/roi_editor/item.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/roi_editor/model.cpp b/src/gui/mrview/tool/roi_editor/model.cpp index bfde162c88..e6c181940a 100644 --- a/src/gui/mrview/tool/roi_editor/model.cpp +++ b/src/gui/mrview/tool/roi_editor/model.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/roi_editor/model.h b/src/gui/mrview/tool/roi_editor/model.h index 07fb90945b..aa55141aec 100644 --- a/src/gui/mrview/tool/roi_editor/model.h +++ b/src/gui/mrview/tool/roi_editor/model.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/roi_editor/roi.cpp b/src/gui/mrview/tool/roi_editor/roi.cpp index 6f10482a47..f821ab34db 100644 --- a/src/gui/mrview/tool/roi_editor/roi.cpp +++ b/src/gui/mrview/tool/roi_editor/roi.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/roi_editor/roi.h b/src/gui/mrview/tool/roi_editor/roi.h index aaf386c175..cbe685166c 100644 --- a/src/gui/mrview/tool/roi_editor/roi.h +++ b/src/gui/mrview/tool/roi_editor/roi.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/roi_editor/undoentry.cpp b/src/gui/mrview/tool/roi_editor/undoentry.cpp index 8a7f55b6e6..9602e52c85 100644 --- a/src/gui/mrview/tool/roi_editor/undoentry.cpp +++ b/src/gui/mrview/tool/roi_editor/undoentry.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/roi_editor/undoentry.h b/src/gui/mrview/tool/roi_editor/undoentry.h index 99cd3a351e..b9dc8da6b4 100644 --- a/src/gui/mrview/tool/roi_editor/undoentry.h +++ b/src/gui/mrview/tool/roi_editor/undoentry.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/screen_capture.cpp b/src/gui/mrview/tool/screen_capture.cpp index c57962fe08..dd953d9a55 100644 --- a/src/gui/mrview/tool/screen_capture.cpp +++ b/src/gui/mrview/tool/screen_capture.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/screen_capture.h b/src/gui/mrview/tool/screen_capture.h index 7277630c89..eb0189c8a3 100644 --- a/src/gui/mrview/tool/screen_capture.h +++ b/src/gui/mrview/tool/screen_capture.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/tractography/track_scalar_file.cpp b/src/gui/mrview/tool/tractography/track_scalar_file.cpp index 9bebbd598b..51ee6bbb9f 100644 --- a/src/gui/mrview/tool/tractography/track_scalar_file.cpp +++ b/src/gui/mrview/tool/tractography/track_scalar_file.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/tractography/track_scalar_file.h b/src/gui/mrview/tool/tractography/track_scalar_file.h index f38e2dbcc8..f2c0721249 100644 --- a/src/gui/mrview/tool/tractography/track_scalar_file.h +++ b/src/gui/mrview/tool/tractography/track_scalar_file.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/tractography/tractogram.cpp b/src/gui/mrview/tool/tractography/tractogram.cpp index fdfe4f3696..da7f6b8e43 100644 --- a/src/gui/mrview/tool/tractography/tractogram.cpp +++ b/src/gui/mrview/tool/tractography/tractogram.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/tractography/tractogram.h b/src/gui/mrview/tool/tractography/tractogram.h index 6050bc389d..ee4b500e7e 100644 --- a/src/gui/mrview/tool/tractography/tractogram.h +++ b/src/gui/mrview/tool/tractography/tractogram.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/tractography/tractogram_enums.h b/src/gui/mrview/tool/tractography/tractogram_enums.h index d3e0866111..0cd870961b 100644 --- a/src/gui/mrview/tool/tractography/tractogram_enums.h +++ b/src/gui/mrview/tool/tractography/tractogram_enums.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/tractography/tractography.cpp b/src/gui/mrview/tool/tractography/tractography.cpp index b1588e574f..d3fdab9c33 100644 --- a/src/gui/mrview/tool/tractography/tractography.cpp +++ b/src/gui/mrview/tool/tractography/tractography.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/tractography/tractography.h b/src/gui/mrview/tool/tractography/tractography.h index f52d2931a1..1969871e7b 100644 --- a/src/gui/mrview/tool/tractography/tractography.h +++ b/src/gui/mrview/tool/tractography/tractography.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/view.cpp b/src/gui/mrview/tool/view.cpp index d244ef93ed..cdfcf4270f 100644 --- a/src/gui/mrview/tool/view.cpp +++ b/src/gui/mrview/tool/view.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/tool/view.h b/src/gui/mrview/tool/view.h index f781d5e657..6368ce22fb 100644 --- a/src/gui/mrview/tool/view.h +++ b/src/gui/mrview/tool/view.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/volume.cpp b/src/gui/mrview/volume.cpp index 138220f8c4..d0006c16d4 100644 --- a/src/gui/mrview/volume.cpp +++ b/src/gui/mrview/volume.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/volume.h b/src/gui/mrview/volume.h index f31f090b18..276ee9f67c 100644 --- a/src/gui/mrview/volume.h +++ b/src/gui/mrview/volume.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/window.cpp b/src/gui/mrview/window.cpp index 6566640c61..1ff4791f16 100644 --- a/src/gui/mrview/window.cpp +++ b/src/gui/mrview/window.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/mrview/window.h b/src/gui/mrview/window.h index 85bfa796e9..5605d0c850 100644 --- a/src/gui/mrview/window.h +++ b/src/gui/mrview/window.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/opengl/font.cpp b/src/gui/opengl/font.cpp index 7f3848801f..2c7874ca41 100644 --- a/src/gui/opengl/font.cpp +++ b/src/gui/opengl/font.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/opengl/font.h b/src/gui/opengl/font.h index a73eeda1a0..7e62eea1cf 100644 --- a/src/gui/opengl/font.h +++ b/src/gui/opengl/font.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/opengl/gl.cpp b/src/gui/opengl/gl.cpp index d394b3bd79..8e29ae39da 100644 --- a/src/gui/opengl/gl.cpp +++ b/src/gui/opengl/gl.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/opengl/gl.h b/src/gui/opengl/gl.h index 03dca5e701..23bdd7d1b7 100644 --- a/src/gui/opengl/gl.h +++ b/src/gui/opengl/gl.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/opengl/gl_core_3_3.cpp b/src/gui/opengl/gl_core_3_3.cpp index 45fb5c8d3a..355ae03ddf 100644 --- a/src/gui/opengl/gl_core_3_3.cpp +++ b/src/gui/opengl/gl_core_3_3.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/opengl/gl_core_3_3.h b/src/gui/opengl/gl_core_3_3.h index 7a44659037..caba00d380 100644 --- a/src/gui/opengl/gl_core_3_3.h +++ b/src/gui/opengl/gl_core_3_3.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/opengl/lighting.cpp b/src/gui/opengl/lighting.cpp index c45e8989a0..482693e4f6 100644 --- a/src/gui/opengl/lighting.cpp +++ b/src/gui/opengl/lighting.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/opengl/lighting.h b/src/gui/opengl/lighting.h index c683c48e82..39d699fbb4 100644 --- a/src/gui/opengl/lighting.h +++ b/src/gui/opengl/lighting.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/opengl/shader.cpp b/src/gui/opengl/shader.cpp index f01c2018f3..d670a3ef9d 100644 --- a/src/gui/opengl/shader.cpp +++ b/src/gui/opengl/shader.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/opengl/shader.h b/src/gui/opengl/shader.h index 391bb93afa..a75ffda02e 100644 --- a/src/gui/opengl/shader.h +++ b/src/gui/opengl/shader.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/opengl/transformation.h b/src/gui/opengl/transformation.h index a4742012dd..b9802db764 100644 --- a/src/gui/opengl/transformation.h +++ b/src/gui/opengl/transformation.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/projection.cpp b/src/gui/projection.cpp index 205a1768ce..2c7d0ca92a 100644 --- a/src/gui/projection.cpp +++ b/src/gui/projection.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/projection.h b/src/gui/projection.h index d4a95f5e31..148cf49546 100644 --- a/src/gui/projection.h +++ b/src/gui/projection.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/shapes/cube.cpp b/src/gui/shapes/cube.cpp index 61ed979b91..bb0c8638e5 100644 --- a/src/gui/shapes/cube.cpp +++ b/src/gui/shapes/cube.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/shapes/cube.h b/src/gui/shapes/cube.h index b4cb43a5ea..4b246e66e1 100644 --- a/src/gui/shapes/cube.h +++ b/src/gui/shapes/cube.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/shapes/cylinder.cpp b/src/gui/shapes/cylinder.cpp index c83f65507f..3b99aae798 100644 --- a/src/gui/shapes/cylinder.cpp +++ b/src/gui/shapes/cylinder.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/shapes/cylinder.h b/src/gui/shapes/cylinder.h index e75915e587..4c0a9dec7c 100644 --- a/src/gui/shapes/cylinder.h +++ b/src/gui/shapes/cylinder.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/shapes/halfsphere.cpp b/src/gui/shapes/halfsphere.cpp index 8f637ba6be..c099491f52 100644 --- a/src/gui/shapes/halfsphere.cpp +++ b/src/gui/shapes/halfsphere.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/shapes/halfsphere.h b/src/gui/shapes/halfsphere.h index 5c84b7d828..75bf57e209 100644 --- a/src/gui/shapes/halfsphere.h +++ b/src/gui/shapes/halfsphere.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/shapes/sphere.cpp b/src/gui/shapes/sphere.cpp index 7ffb8038cb..47006b2990 100644 --- a/src/gui/shapes/sphere.cpp +++ b/src/gui/shapes/sphere.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/shapes/sphere.h b/src/gui/shapes/sphere.h index 70608a642b..fa0a234525 100644 --- a/src/gui/shapes/sphere.h +++ b/src/gui/shapes/sphere.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/shview/icons.h b/src/gui/shview/icons.h index a1397fad50..751570537a 100644 --- a/src/gui/shview/icons.h +++ b/src/gui/shview/icons.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/shview/render_window.cpp b/src/gui/shview/render_window.cpp index 51e372bfb0..ebaae5b487 100644 --- a/src/gui/shview/render_window.cpp +++ b/src/gui/shview/render_window.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/gui/shview/render_window.h b/src/gui/shview/render_window.h index eeda6f3c0b..44d2497084 100644 --- a/src/gui/shview/render_window.h +++ b/src/gui/shview/render_window.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/min_mem_array.h b/src/min_mem_array.h index 51cc112b1e..c60ae7bb60 100644 --- a/src/min_mem_array.h +++ b/src/min_mem_array.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/project_version.h b/src/project_version.h index e4ee0cfe81..7598958c0c 100644 --- a/src/project_version.h +++ b/src/project_version.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/linear.cpp b/src/registration/linear.cpp index c2fff7ee13..1bd66569a9 100644 --- a/src/registration/linear.cpp +++ b/src/registration/linear.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/linear.h b/src/registration/linear.h index 7757c01c08..bea44c0cb1 100644 --- a/src/registration/linear.h +++ b/src/registration/linear.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/metric/cross_correlation.h b/src/registration/metric/cross_correlation.h index c46b3976ec..be111a2e2e 100644 --- a/src/registration/metric/cross_correlation.h +++ b/src/registration/metric/cross_correlation.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/metric/demons.h b/src/registration/metric/demons.h index 19cb27f04b..5383b3f2d4 100644 --- a/src/registration/metric/demons.h +++ b/src/registration/metric/demons.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/metric/demons4D.h b/src/registration/metric/demons4D.h index 5bca938c8d..77388222b7 100644 --- a/src/registration/metric/demons4D.h +++ b/src/registration/metric/demons4D.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/metric/difference_robust.h b/src/registration/metric/difference_robust.h index 093a237e6b..1b8c782e1c 100644 --- a/src/registration/metric/difference_robust.h +++ b/src/registration/metric/difference_robust.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/metric/evaluate.h b/src/registration/metric/evaluate.h index 1c8cd81ace..dffda63119 100644 --- a/src/registration/metric/evaluate.h +++ b/src/registration/metric/evaluate.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/metric/mean_squared.h b/src/registration/metric/mean_squared.h index 371a561995..bdf8c0a07f 100644 --- a/src/registration/metric/mean_squared.h +++ b/src/registration/metric/mean_squared.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/metric/normalised_cross_correlation.h b/src/registration/metric/normalised_cross_correlation.h index 12e972d2d4..29a8ac1a31 100644 --- a/src/registration/metric/normalised_cross_correlation.h +++ b/src/registration/metric/normalised_cross_correlation.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/metric/params.h b/src/registration/metric/params.h index fe6b9202c3..4de91d4a56 100644 --- a/src/registration/metric/params.h +++ b/src/registration/metric/params.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/metric/robust_estimators.h b/src/registration/metric/robust_estimators.h index 80092aabf3..039c7fe3b1 100644 --- a/src/registration/metric/robust_estimators.h +++ b/src/registration/metric/robust_estimators.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/metric/thread_kernel.h b/src/registration/metric/thread_kernel.h index cbaf64676d..7cac874986 100644 --- a/src/registration/metric/thread_kernel.h +++ b/src/registration/metric/thread_kernel.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/multi_resolution_lmax.h b/src/registration/multi_resolution_lmax.h index 8148520331..bd3081a85f 100644 --- a/src/registration/multi_resolution_lmax.h +++ b/src/registration/multi_resolution_lmax.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/nonlinear.cpp b/src/registration/nonlinear.cpp index f32c235f7c..462cb2c27a 100644 --- a/src/registration/nonlinear.cpp +++ b/src/registration/nonlinear.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/nonlinear.h b/src/registration/nonlinear.h index 0fb1a16e51..395c86125a 100644 --- a/src/registration/nonlinear.h +++ b/src/registration/nonlinear.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/transform/affine.cpp b/src/registration/transform/affine.cpp index 48561158e5..06b15652ad 100644 --- a/src/registration/transform/affine.cpp +++ b/src/registration/transform/affine.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/transform/affine.h b/src/registration/transform/affine.h index 5081f65531..e4e57ab20e 100644 --- a/src/registration/transform/affine.h +++ b/src/registration/transform/affine.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/transform/base.h b/src/registration/transform/base.h index a2a576da8c..aed33e8d39 100644 --- a/src/registration/transform/base.h +++ b/src/registration/transform/base.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/transform/convergence_check.cpp b/src/registration/transform/convergence_check.cpp index a4116cf45e..3bcfe9ca24 100644 --- a/src/registration/transform/convergence_check.cpp +++ b/src/registration/transform/convergence_check.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/transform/convergence_check.h b/src/registration/transform/convergence_check.h index d211ba9e8c..35c557525d 100644 --- a/src/registration/transform/convergence_check.h +++ b/src/registration/transform/convergence_check.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/transform/initialiser.cpp b/src/registration/transform/initialiser.cpp index c857db655c..a71b3a6c1c 100644 --- a/src/registration/transform/initialiser.cpp +++ b/src/registration/transform/initialiser.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/transform/initialiser.h b/src/registration/transform/initialiser.h index db3fa33bb3..4b9170af36 100644 --- a/src/registration/transform/initialiser.h +++ b/src/registration/transform/initialiser.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/transform/initialiser_helpers.cpp b/src/registration/transform/initialiser_helpers.cpp index b39edfd436..b9f9cd54bb 100644 --- a/src/registration/transform/initialiser_helpers.cpp +++ b/src/registration/transform/initialiser_helpers.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/transform/initialiser_helpers.h b/src/registration/transform/initialiser_helpers.h index b465e0aae9..0ac9942a40 100644 --- a/src/registration/transform/initialiser_helpers.h +++ b/src/registration/transform/initialiser_helpers.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/transform/reorient.h b/src/registration/transform/reorient.h index 48220b155a..263fc81c4f 100644 --- a/src/registration/transform/reorient.h +++ b/src/registration/transform/reorient.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/transform/rigid.cpp b/src/registration/transform/rigid.cpp index 500c448c9d..dcc6a1d08d 100644 --- a/src/registration/transform/rigid.cpp +++ b/src/registration/transform/rigid.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/transform/rigid.h b/src/registration/transform/rigid.h index 038f84ed93..a00b5ddb27 100644 --- a/src/registration/transform/rigid.h +++ b/src/registration/transform/rigid.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/transform/search.h b/src/registration/transform/search.h index 4e23814013..cca8240121 100644 --- a/src/registration/transform/search.h +++ b/src/registration/transform/search.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/warp/compose.h b/src/registration/warp/compose.h index f5d338188b..929e30b59a 100644 --- a/src/registration/warp/compose.h +++ b/src/registration/warp/compose.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/warp/convert.h b/src/registration/warp/convert.h index 5e3df314d3..7500da1127 100644 --- a/src/registration/warp/convert.h +++ b/src/registration/warp/convert.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/warp/helpers.h b/src/registration/warp/helpers.h index 1d193c9d76..434f0bc581 100644 --- a/src/registration/warp/helpers.h +++ b/src/registration/warp/helpers.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/registration/warp/invert.h b/src/registration/warp/invert.h index a244e87055..99c7718fa6 100644 --- a/src/registration/warp/invert.h +++ b/src/registration/warp/invert.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/stats/cfe.cpp b/src/stats/cfe.cpp index 83d21dbef5..e7e59ea0f7 100644 --- a/src/stats/cfe.cpp +++ b/src/stats/cfe.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/stats/cfe.h b/src/stats/cfe.h index 5c62d8cb7d..6e2dc68c70 100644 --- a/src/stats/cfe.h +++ b/src/stats/cfe.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/stats/cluster.cpp b/src/stats/cluster.cpp index 932da39c70..c5fadaf94e 100644 --- a/src/stats/cluster.cpp +++ b/src/stats/cluster.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/stats/cluster.h b/src/stats/cluster.h index 77dc8d49c2..4373b332f9 100644 --- a/src/stats/cluster.h +++ b/src/stats/cluster.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/stats/enhance.h b/src/stats/enhance.h index 7dba268ed8..1349660408 100644 --- a/src/stats/enhance.h +++ b/src/stats/enhance.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/stats/permstack.cpp b/src/stats/permstack.cpp index 23c2712606..0b340974ad 100644 --- a/src/stats/permstack.cpp +++ b/src/stats/permstack.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/stats/permstack.h b/src/stats/permstack.h index 605319b96b..0d98f7758a 100644 --- a/src/stats/permstack.h +++ b/src/stats/permstack.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/stats/permtest.cpp b/src/stats/permtest.cpp index a0351fe4a6..0ccb7b3076 100644 --- a/src/stats/permtest.cpp +++ b/src/stats/permtest.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/stats/permtest.h b/src/stats/permtest.h index c0202adb3d..82fdc14cb9 100644 --- a/src/stats/permtest.h +++ b/src/stats/permtest.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/stats/tfce.cpp b/src/stats/tfce.cpp index fabcdbc304..1272bcb13c 100644 --- a/src/stats/tfce.cpp +++ b/src/stats/tfce.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/stats/tfce.h b/src/stats/tfce.h index 16aeda885c..295b0306cb 100644 --- a/src/stats/tfce.h +++ b/src/stats/tfce.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/algo/image2mesh.h b/src/surface/algo/image2mesh.h index bfc2df8472..78468cee07 100644 --- a/src/surface/algo/image2mesh.h +++ b/src/surface/algo/image2mesh.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/algo/mesh2image.cpp b/src/surface/algo/mesh2image.cpp index b4280330b7..68a3a0ccec 100644 --- a/src/surface/algo/mesh2image.cpp +++ b/src/surface/algo/mesh2image.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/algo/mesh2image.h b/src/surface/algo/mesh2image.h index c392adf15b..96bd05dd98 100644 --- a/src/surface/algo/mesh2image.h +++ b/src/surface/algo/mesh2image.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/filter/base.cpp b/src/surface/filter/base.cpp index 1258d2c594..97ae9d1634 100644 --- a/src/surface/filter/base.cpp +++ b/src/surface/filter/base.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/filter/base.h b/src/surface/filter/base.h index 1086bd5ba8..548984b593 100644 --- a/src/surface/filter/base.h +++ b/src/surface/filter/base.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/filter/smooth.cpp b/src/surface/filter/smooth.cpp index aab977c041..4588d605dc 100644 --- a/src/surface/filter/smooth.cpp +++ b/src/surface/filter/smooth.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/filter/smooth.h b/src/surface/filter/smooth.h index 4ddc555c74..97300cae74 100644 --- a/src/surface/filter/smooth.h +++ b/src/surface/filter/smooth.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/filter/vertex_transform.cpp b/src/surface/filter/vertex_transform.cpp index 6e284c07d7..7df4a7b2eb 100644 --- a/src/surface/filter/vertex_transform.cpp +++ b/src/surface/filter/vertex_transform.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/filter/vertex_transform.h b/src/surface/filter/vertex_transform.h index 5e70aa0f7c..b3388bb20d 100644 --- a/src/surface/filter/vertex_transform.h +++ b/src/surface/filter/vertex_transform.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/freesurfer.cpp b/src/surface/freesurfer.cpp index 5994132e45..075bd211bc 100644 --- a/src/surface/freesurfer.cpp +++ b/src/surface/freesurfer.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/freesurfer.h b/src/surface/freesurfer.h index 6e17288a26..7671562ce8 100644 --- a/src/surface/freesurfer.h +++ b/src/surface/freesurfer.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/mesh.cpp b/src/surface/mesh.cpp index 53bffa8e65..5cefedcb34 100644 --- a/src/surface/mesh.cpp +++ b/src/surface/mesh.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/mesh.h b/src/surface/mesh.h index aaefe03bc8..170a645381 100644 --- a/src/surface/mesh.h +++ b/src/surface/mesh.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/mesh_multi.cpp b/src/surface/mesh_multi.cpp index 3c6662cb4f..3eebbf0db1 100644 --- a/src/surface/mesh_multi.cpp +++ b/src/surface/mesh_multi.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/mesh_multi.h b/src/surface/mesh_multi.h index ef4d3ba1d1..ca213c7800 100644 --- a/src/surface/mesh_multi.h +++ b/src/surface/mesh_multi.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/polygon.cpp b/src/surface/polygon.cpp index 7ab5112173..0da2c0b4f8 100644 --- a/src/surface/polygon.cpp +++ b/src/surface/polygon.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/polygon.h b/src/surface/polygon.h index e873bf1d99..98e920a867 100644 --- a/src/surface/polygon.h +++ b/src/surface/polygon.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/scalar.cpp b/src/surface/scalar.cpp index a18a56cc08..fadc4a6503 100644 --- a/src/surface/scalar.cpp +++ b/src/surface/scalar.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/scalar.h b/src/surface/scalar.h index f384d13c2f..bd328d7dbf 100644 --- a/src/surface/scalar.h +++ b/src/surface/scalar.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/types.h b/src/surface/types.h index 855471c8c1..b00ae5c7b3 100644 --- a/src/surface/types.h +++ b/src/surface/types.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/surface/utils.h b/src/surface/utils.h index 8a7bdeecda..450c8f1010 100644 --- a/src/surface/utils.h +++ b/src/surface/utils.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/src/wrap_r.h b/src/wrap_r.h index cb075aadd6..dffa095789 100644 --- a/src/wrap_r.h +++ b/src/wrap_r.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/testing/cmd/testing_diff_dir.cpp b/testing/cmd/testing_diff_dir.cpp index 4c96ec91f6..1e5836caeb 100644 --- a/testing/cmd/testing_diff_dir.cpp +++ b/testing/cmd/testing_diff_dir.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/testing/cmd/testing_diff_fixel.cpp b/testing/cmd/testing_diff_fixel.cpp index 8636a79965..9f92392673 100644 --- a/testing/cmd/testing_diff_fixel.cpp +++ b/testing/cmd/testing_diff_fixel.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/testing/cmd/testing_diff_fixel_old.cpp b/testing/cmd/testing_diff_fixel_old.cpp index cbf8360961..03038ce278 100644 --- a/testing/cmd/testing_diff_fixel_old.cpp +++ b/testing/cmd/testing_diff_fixel_old.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/testing/cmd/testing_diff_image.cpp b/testing/cmd/testing_diff_image.cpp index a3f475a549..47c6e45369 100644 --- a/testing/cmd/testing_diff_image.cpp +++ b/testing/cmd/testing_diff_image.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/testing/cmd/testing_diff_matrix.cpp b/testing/cmd/testing_diff_matrix.cpp index 1d8d5d78c7..dd21b0fbb3 100644 --- a/testing/cmd/testing_diff_matrix.cpp +++ b/testing/cmd/testing_diff_matrix.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/testing/cmd/testing_diff_mesh.cpp b/testing/cmd/testing_diff_mesh.cpp index f7ae147d9a..d1962068ca 100644 --- a/testing/cmd/testing_diff_mesh.cpp +++ b/testing/cmd/testing_diff_mesh.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/testing/cmd/testing_diff_peaks.cpp b/testing/cmd/testing_diff_peaks.cpp index 55806d204e..07c83b62d4 100644 --- a/testing/cmd/testing_diff_peaks.cpp +++ b/testing/cmd/testing_diff_peaks.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/testing/cmd/testing_diff_tck.cpp b/testing/cmd/testing_diff_tck.cpp index 1d8c74b9c0..42d00fa8b4 100644 --- a/testing/cmd/testing_diff_tck.cpp +++ b/testing/cmd/testing_diff_tck.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/testing/cmd/testing_diff_tsf.cpp b/testing/cmd/testing_diff_tsf.cpp index 7d2f91999f..49dfb62097 100644 --- a/testing/cmd/testing_diff_tsf.cpp +++ b/testing/cmd/testing_diff_tsf.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/testing/cmd/testing_gen_data.cpp b/testing/cmd/testing_gen_data.cpp index ac2cb150a9..581558104b 100644 --- a/testing/cmd/testing_gen_data.cpp +++ b/testing/cmd/testing_gen_data.cpp @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ diff --git a/testing/src/diff_images.h b/testing/src/diff_images.h index fd34580527..440afa3d10 100644 --- a/testing/src/diff_images.h +++ b/testing/src/diff_images.h @@ -1,14 +1,15 @@ -/* Copyright (c) 2008-2017 the MRtrix3 contributors. +/* + * Copyright (c) 2008-2018 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * file, you can obtain one at http://mozilla.org/MPL/2.0/ * - * MRtrix is distributed in the hope that it will be useful, + * MRtrix3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * For more details, see http://www.mrtrix.org/. + * For more details, see http://www.mrtrix.org/ */ From b2ff414c71ae4ff949a8b280ae469d3c1e9dad28 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 14 Dec 2017 14:26:08 +1100 Subject: [PATCH 266/538] fixel2tsf: Don't propagate non-finite values With the introduction of the -mask option in fixelcfestats (#1030), fixel data files may contain the value NaN to indicate fixels that were outside the processing mask. However if such values were read within fixel2tsf, and hence propagated to the output track scalar file, these would be erroneously interpreted as track delimiters. This fix replaces non-finite values with 0.0 in fixel2tsf to overcome this limitation of the .tck / .tsf formats. Some assert() calls have also been added to the relevant code in mrview to ensure that any loaded .tsf file does indeed align perfectly with the corresponding track file. --- cmd/fixel2tsf.cpp | 14 +++-- .../mrview/tool/tractography/tractogram.cpp | 56 ++++++++++++------- src/gui/mrview/tool/tractography/tractogram.h | 6 +- 3 files changed, 49 insertions(+), 27 deletions(-) diff --git a/cmd/fixel2tsf.cpp b/cmd/fixel2tsf.cpp index 0c25de23ce..7860863d6a 100644 --- a/cmd/fixel2tsf.cpp +++ b/cmd/fixel2tsf.cpp @@ -98,7 +98,7 @@ void run () while (reader (tck)) { SetVoxelDir dixels; mapper (tck, dixels); - vector scalars (tck.size(), 0.0); + vector scalars (tck.size(), 0.0f); for (size_t p = 0; p < tck.size(); ++p) { voxel_pos = transform.scanner2voxel * tck[p].cast (); for (SetVoxelDir::const_iterator d = dixels.begin(); d != dixels.end(); ++d) { @@ -106,7 +106,7 @@ void run () assign_pos_of (*d).to (in_index_image); Eigen::Vector3f dir = d->get_dir().cast(); dir.normalize(); - float largest_dp = 0.0; + float largest_dp = 0.0f; int32_t closest_fixel_index = -1; in_index_image.index(3) = 0; @@ -116,7 +116,7 @@ void run () for (size_t fixel = 0; fixel < num_fixels_in_voxel; ++fixel) { in_directions_image.index(0) = offset + fixel; - float dp = std::abs (dir.dot (Eigen::Vector3f (in_directions_image.row(1)))); + const float dp = std::abs (dir.dot (Eigen::Vector3f (in_directions_image.row(1)))); if (dp > largest_dp) { largest_dp = dp; closest_fixel_index = fixel; @@ -124,9 +124,13 @@ void run () } if (largest_dp > angular_threshold_dp) { in_data_image.index(0) = offset + closest_fixel_index; - scalars[p] = in_data_image.value(); + const float value = in_data_image.value(); + if (std::isfinite (value)) + scalars[p] = in_data_image.value(); + else + scalars[p] = 0.0f; } else { - scalars[p] = 0.0; + scalars[p] = 0.0f; } break; } diff --git a/src/gui/mrview/tool/tractography/tractogram.cpp b/src/gui/mrview/tool/tractography/tractogram.cpp index fdfe4f3696..140b35b000 100644 --- a/src/gui/mrview/tool/tractography/tractogram.cpp +++ b/src/gui/mrview/tool/tractography/tractogram.cpp @@ -616,8 +616,8 @@ namespace MR while (file (tck)) { - size_t N = tck.size(); - if(!N) continue; + const size_t N = tck.size(); + if (!N) continue; // Pre padding // To support downsampling, we want to ensure that the starting track vertex @@ -633,7 +633,7 @@ namespace MR // Similarly, to support downsampling, we also want to ensure the final track vertex // will be used even we're using a stride > 1 for (size_t i = 0; i < track_padding; ++i) - buffer.push_back(tck.back()); + buffer.push_back (tck.back()); sizes.push_back (N); tck_count++; @@ -642,9 +642,8 @@ namespace MR endpoint_tangents.push_back ((tck.back() - tck.front()).normalized()); } - if (buffer.size()) { + if (buffer.size()) load_tracks_onto_GPU (buffer, starts, sizes, tck_count); - } file.close(); ASSERT_GL_MRVIEW_CONTEXT_IS_CURRENT; } @@ -682,6 +681,7 @@ namespace MR } load_end_colours_onto_GPU (buffer); } + assert (colour_buffers.size() == vertex_buffers.size()); // Don't need this now that we've initialised the GPU buffers endpoint_tangents.clear(); ASSERT_GL_MRVIEW_CONTEXT_IS_CURRENT; @@ -708,11 +708,13 @@ namespace MR DWI::Tractography::Properties scalar_properties; DWI::Tractography::ScalarReader file (filename, scalar_properties); DWI::Tractography::check_properties_match (properties, scalar_properties, ".tck / .tsf"); + size_t tck_count = 0; while (file (tck_scalar)) { - size_t tck_size = tck_scalar.size(); + const size_t tck_size = tck_scalar.size(); + assert (tck_size == size_t(track_sizes[intensity_scalar_buffers.size()][tck_count])); - if(!tck_size) + if (!tck_size) continue; // Pre padding to coincide with tracks buffer @@ -729,11 +731,13 @@ namespace MR for (size_t i = 0; i < track_padding; ++i) buffer.push_back (tck_scalar.back()); + ++tck_count; + if (buffer.size() >= MAX_BUFFER_SIZE) - load_intensity_scalars_onto_GPU (buffer); + load_intensity_scalars_onto_GPU (buffer, tck_count); } if (buffer.size()) - load_intensity_scalars_onto_GPU (buffer); + load_intensity_scalars_onto_GPU (buffer, tck_count); file.close(); } else { const Eigen::VectorXf scalars = MR::load_vector (filename); @@ -745,7 +749,8 @@ namespace MR size_t running_index = 0; for (size_t buffer_index = 0; buffer_index != vertex_buffers.size(); ++buffer_index) { - const size_t num_tracks = num_tracks_per_buffer[buffer_index]; + + size_t num_tracks = num_tracks_per_buffer[buffer_index]; vector& track_lengths (original_track_sizes[buffer_index]); for (size_t index = 0; index != num_tracks; ++index, ++running_index) { @@ -766,9 +771,10 @@ namespace MR value_min = std::min (value_min, value); } - load_intensity_scalars_onto_GPU (buffer); + load_intensity_scalars_onto_GPU (buffer, num_tracks); } } + assert (intensity_scalar_buffers.size() == vertex_buffers.size()); intensity_scalar_filename = filename; this->set_windowing (value_min, value_max); if (!std::isfinite (greaterthan)) @@ -797,11 +803,13 @@ namespace MR DWI::Tractography::Properties scalar_properties; DWI::Tractography::ScalarReader file (filename, scalar_properties); DWI::Tractography::check_properties_match (properties, scalar_properties, ".tck / .tsf"); + size_t tck_count = 0; while (file (tck_scalar)) { - size_t tck_size = tck_scalar.size(); + const size_t tck_size = tck_scalar.size(); + assert (tck_size == size_t(track_sizes[intensity_scalar_buffers.size()][tck_count])); - if(!tck_size) + if (!tck_size) continue; // Pre padding to coincide with tracks buffer @@ -818,11 +826,13 @@ namespace MR for (size_t i = 0; i < track_padding; ++i) buffer.push_back (tck_scalar.back()); + ++tck_count; + if (buffer.size() >= MAX_BUFFER_SIZE) - load_threshold_scalars_onto_GPU (buffer); + load_threshold_scalars_onto_GPU (buffer, tck_count); } if (buffer.size()) - load_threshold_scalars_onto_GPU (buffer); + load_threshold_scalars_onto_GPU (buffer, tck_count); file.close(); } else { const Eigen::VectorXf scalars = MR::load_vector (filename); @@ -834,7 +844,8 @@ namespace MR size_t running_index = 0; for (size_t buffer_index = 0; buffer_index != vertex_buffers.size(); ++buffer_index) { - const size_t num_tracks = num_tracks_per_buffer[buffer_index]; + + size_t num_tracks = num_tracks_per_buffer[buffer_index]; vector& track_lengths (original_track_sizes[buffer_index]); for (size_t index = 0; index != num_tracks; ++index, ++running_index) { @@ -855,9 +866,10 @@ namespace MR threshold_min = std::min (threshold_min, value); } - load_threshold_scalars_onto_GPU (buffer); + load_threshold_scalars_onto_GPU (buffer, num_tracks); } } + assert (threshold_scalar_buffers.size() == vertex_buffers.size()); threshold_scalar_filename = filename; greaterthan = threshold_max; lessthan = threshold_min; @@ -996,10 +1008,12 @@ namespace MR - void Tractogram::load_intensity_scalars_onto_GPU (vector& buffer) + void Tractogram::load_intensity_scalars_onto_GPU (vector& buffer, size_t& tck_count) { ASSERT_GL_MRVIEW_CONTEXT_IS_CURRENT; + assert (num_tracks_per_buffer[intensity_scalar_buffers.size()] == tck_count); + GLuint vertexbuffer; gl::GenBuffers (1, &vertexbuffer); gl::BindBuffer (gl::ARRAY_BUFFER, vertexbuffer); @@ -1009,6 +1023,7 @@ namespace MR intensity_scalar_buffers.push_back (vertexbuffer); buffer.clear(); + tck_count = 0; ASSERT_GL_MRVIEW_CONTEXT_IS_CURRENT; } @@ -1016,10 +1031,12 @@ namespace MR - void Tractogram::load_threshold_scalars_onto_GPU (vector& buffer) + void Tractogram::load_threshold_scalars_onto_GPU (vector& buffer, size_t& tck_count) { ASSERT_GL_MRVIEW_CONTEXT_IS_CURRENT; + assert (num_tracks_per_buffer[threshold_scalar_buffers.size()] == tck_count); + GLuint vertexbuffer; gl::GenBuffers (1, &vertexbuffer); gl::BindBuffer (gl::ARRAY_BUFFER, vertexbuffer); @@ -1029,6 +1046,7 @@ namespace MR threshold_scalar_buffers.push_back (vertexbuffer); buffer.clear(); + tck_count = 0; ASSERT_GL_MRVIEW_CONTEXT_IS_CURRENT; } diff --git a/src/gui/mrview/tool/tractography/tractogram.h b/src/gui/mrview/tool/tractography/tractogram.h index 6050bc389d..7dd5bc9f04 100644 --- a/src/gui/mrview/tool/tractography/tractogram.h +++ b/src/gui/mrview/tool/tractography/tractogram.h @@ -159,11 +159,11 @@ namespace MR vector& starts, vector& sizes, size_t& tck_count); - + void load_end_colours_onto_GPU (vector&); - void load_intensity_scalars_onto_GPU (vector& buffer); - void load_threshold_scalars_onto_GPU (vector& buffer); + void load_intensity_scalars_onto_GPU (vector& buffer, size_t& tck_count); + void load_threshold_scalars_onto_GPU (vector& buffer, size_t& tck_count); void render_streamlines (); From 67acd5e40b6253a7bd78330a908dc289ef3069a2 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 14 Dec 2017 14:43:58 +1100 Subject: [PATCH 267/538] New command: tsfvalidate This command performs a thorough check to ensure that a given track scalar file is valid to be used in conjunction with a particular track file. --- cmd/tsfvalidate.cpp | 119 ++++++++++++++++++++++++ docs/reference/commands/shbasis.rst | 2 +- docs/reference/commands/tsfvalidate.rst | 59 ++++++++++++ docs/reference/commands_list.rst | 2 + 4 files changed, 181 insertions(+), 1 deletion(-) create mode 100644 cmd/tsfvalidate.cpp create mode 100644 docs/reference/commands/tsfvalidate.rst diff --git a/cmd/tsfvalidate.cpp b/cmd/tsfvalidate.cpp new file mode 100644 index 0000000000..4801180e15 --- /dev/null +++ b/cmd/tsfvalidate.cpp @@ -0,0 +1,119 @@ +/* Copyright (c) 2008-2017 the MRtrix3 contributors. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at http://mozilla.org/MPL/2.0/. + * + * MRtrix is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * For more details, see http://www.mrtrix.org/. + */ + + +#include "command.h" +#include "progressbar.h" +#include "types.h" +#include "dwi/tractography/file.h" +#include "dwi/tractography/scalar_file.h" +#include "dwi/tractography/streamline.h" +#include "dwi/tractography/properties.h" + + +using namespace MR; +using namespace MR::DWI::Tractography; +using namespace App; + + +void usage () +{ + AUTHOR = "Robert E. Smith (robert.smith@florey.edu.au)"; + + SYNOPSIS = "Validate a track scalar file against the corresponding track data"; + + ARGUMENTS + + Argument ("tsf", "the input track scalar file").type_file_in() + + Argument ("tracks", "the track file on which the TSF is based").type_file_in(); +} + + +typedef float value_type; + + +void run () +{ + Properties tsf_properties, tck_properties; + ScalarReader tsf_reader (argument[0], tsf_properties); + Reader tck_reader (argument[1], tck_properties); + size_t error_count = 0; + + Properties::const_iterator tsf_count_field = tsf_properties.find ("count"); + Properties::const_iterator tck_count_field = tck_properties.find ("count"); + size_t tsf_header_count = 0, tck_header_count = 0; + if (tsf_count_field == tsf_properties.end() || tck_count_field == tck_properties.end()) { + WARN ("Unable to verify equal track counts: \"count\" field absent from file header"); + } else { + tsf_header_count = to (tsf_count_field->second); + tck_header_count = to (tck_count_field->second); + if (tsf_header_count != tck_header_count) { + CONSOLE ("\"count\" fields in file headers do not match"); + ++error_count; + } + } + + Properties::const_iterator tsf_timestamp_field = tsf_properties.find ("timestamp"); + Properties::const_iterator tck_timestamp_field = tck_properties.find ("timestamp"); + if (tsf_timestamp_field == tsf_properties.end() || tck_timestamp_field == tck_properties.end()) { + WARN ("Unable to verify equal file timestamps: \"timestamp\" field absent from file header"); + } else if (tsf_timestamp_field->second != tck_timestamp_field->second) { + CONSOLE ("\"timestamp\" fields in file headers do not match"); + ++error_count; + } + + Streamline track; + vector scalar; + size_t tck_counter = 0, tsf_counter = 0, length_mismatch_count = 0; + + { + ProgressBar progress ("Validating track scalar file", tck_header_count); + while (tck_reader (track)) { + ++tck_counter; + if (tsf_reader (scalar)) { + ++tsf_counter; + if (track.size() != scalar.size()) + ++length_mismatch_count; + } + ++progress; + } + + while (tsf_reader (scalar)) { + ++tsf_counter; + ++progress; + } + } + + if (tsf_header_count && tsf_counter != tsf_header_count) { + CONSOLE ("Actual number of tracks counted in scalar file (" + str(tsf_counter) + ") does not match number reported in header (" + str(tsf_header_count) + ")"); + ++error_count; + } + if (tck_header_count && tck_counter != tck_header_count) { + CONSOLE ("Actual number of tracks counted in track file (" + str(tck_counter) + ") does not match number reported in header (" + str(tck_header_count) + ")"); + ++error_count; + } + if (tck_counter != tsf_counter) { + CONSOLE ("Actual number of tracks counter in scalar file (" + str(tsf_counter) + ") does not match actual number of tracks counted in track file (" + str(tck_counter) + ")"); + ++error_count; + } + if (length_mismatch_count) { + CONSOLE (str(length_mismatch_count) + " track" + (length_mismatch_count == 1 ? " was" : "s were") + " detected with different lengths between track and scalar data"); + ++error_count; + } + if (error_count > 1) { + throw Exception ("Multiple errors detected"); + } else if (error_count) { + throw Exception ("Error detected"); + } else { + CONSOLE ("Track scalar file data checked OK"); + } +} diff --git a/docs/reference/commands/shbasis.rst b/docs/reference/commands/shbasis.rst index 6833434e42..2b9c36d2c0 100644 --- a/docs/reference/commands/shbasis.rst +++ b/docs/reference/commands/shbasis.rst @@ -20,7 +20,7 @@ Usage Description ----------- -In previous versions of MRtrix, the convention used for storing spherical harmonic coefficients was a non-orthonormal basis (the m!=0 coefficients were a factor of sqrt(2) too large). This error has been rectified in the new MRtrix (assuming that compilation was performed without the USE_NON_ORTHONORMAL_SH_BASIS symbol defined), but will cause issues if processing SH data that was generated using an older version of MRtrix (or vice-versa). +In previous versions of MRtrix, the convention used for storing spherical harmonic coefficients was a non-orthonormal basis (the m!=0 coefficients were a factor of sqrt(2) too large). This error has been rectified in newer versions of MRtrix, but will cause issues if processing SH data that was generated using an older version of MRtrix (or vice-versa). This command provides a mechanism for testing the basis used in storage of image data representing a spherical harmonic series per voxel, and allows the user to forcibly modify the raw image data to conform to the desired basis. diff --git a/docs/reference/commands/tsfvalidate.rst b/docs/reference/commands/tsfvalidate.rst new file mode 100644 index 0000000000..8ec920dda4 --- /dev/null +++ b/docs/reference/commands/tsfvalidate.rst @@ -0,0 +1,59 @@ +.. _tsfvalidate: + +tsfvalidate +=================== + +Synopsis +-------- + +Validate a track scalar file against the corresponding track data + +Usage +-------- + +:: + + tsfvalidate [ options ] tsf tracks + +- *tsf*: the input track scalar file +- *tracks*: the track file on which the TSF is based + +Options +------- + +Standard options +^^^^^^^^^^^^^^^^ + +- **-info** display information messages. + +- **-quiet** do not display information messages or progress status. Alternatively, this can be achieved by setting the MRTRIX_QUIET environment variable to a non-empty string. + +- **-debug** display debugging messages. + +- **-force** force overwrite of output files. Caution: Using the same file as input and output might cause unexpected behaviour. + +- **-nthreads number** use this number of threads in multi-threaded applications (set to 0 to disable multi-threading). + +- **-help** display this information page and exit. + +- **-version** display version information and exit. + +-------------- + + + +**Author:** Robert E. Smith (robert.smith@florey.edu.au) + +**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors. + +This Source Code Form is subject to the terms of the Mozilla Public +License, v. 2.0. If a copy of the MPL was not distributed with this +file, you can obtain one at http://mozilla.org/MPL/2.0/. + +MRtrix is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty +of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +For more details, see http://www.mrtrix.org/. + + diff --git a/docs/reference/commands_list.rst b/docs/reference/commands_list.rst index 2525cd621c..71c15051e9 100644 --- a/docs/reference/commands_list.rst +++ b/docs/reference/commands_list.rst @@ -112,6 +112,7 @@ List of MRtrix3 commands commands/tsfmult commands/tsfsmooth commands/tsfthreshold + commands/tsfvalidate commands/vectorstats commands/voxel2fixel commands/warp2metric @@ -225,6 +226,7 @@ List of MRtrix3 commands :ref:`tsfmult`, "Multiply corresponding values in track scalar files" :ref:`tsfsmooth`, "Gaussian filter a track scalar file" :ref:`tsfthreshold`, "Threshold and invert track scalar files" + :ref:`tsfvalidate`, "Validate a track scalar file against the corresponding track data" :ref:`vectorstats`, "Statistical testing of vector data using non-parametric permutation testing" :ref:`voxel2fixel`, "Map the scalar value in each voxel to all fixels within that voxel" :ref:`warp2metric`, "Compute fixel-wise or voxel-wise metrics from a 4D deformation field" From 52828e51b4013fec46890a30ebdf2f670c40806d Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Fri, 15 Dec 2017 14:06:36 +1100 Subject: [PATCH 268/538] resuming re-writing of response function estimation documentation, starting with a fresh revision --- .../response_function_estimation.rst | 51 ++++++++----------- 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/docs/constrained_spherical_deconvolution/response_function_estimation.rst b/docs/constrained_spherical_deconvolution/response_function_estimation.rst index 7996234308..e3ed03ba88 100644 --- a/docs/constrained_spherical_deconvolution/response_function_estimation.rst +++ b/docs/constrained_spherical_deconvolution/response_function_estimation.rst @@ -3,13 +3,13 @@ Response function estimation ============================ -A prerequisite for spherical deconvolution is obtaining response +A prerequisite for spherical deconvolution is obtaining (the) response function(s), which is/are used as the kernel(s) by the deconvolution algorithm. For the white matter, the response function is the signal expected for a voxel containing a single, coherently oriented bundle of axons. In case of multi-tissue variants of spherical deconvolution, -response functions for other tissue types may be introduced as well; -the most common ones being grey matter and/or CSF. +response functions of other tissue types are introduced as well; +typically to represent grey matter(-like) and/or CSF signals. In MRtrix3, the :ref:`dwi2response` script offers a range of algorithms to estimate these response function(s) directly from your dataset itself. @@ -88,10 +88,9 @@ to what they deliver (as output) and require (as input), notably also additional input(s) (``msmt_5tt`` requires a 5TT segmentation from a spatially aligned anatomical image) -Beyond these general categories, the algorithms differ mostly in how -they derive the voxels that will be used to estimate the response -function(s) from, and to a lesser extent also how they derive the fibre -orientation for single-fibre voxels. +Beyond these general categories, the algorithms differ mostly in the actual +strategy used to determine the voxels that will be used to estimate +the response function(s) from. The ``manual`` choice is an exception to most of the above, in that it allows/*requires* you to provide the voxels yourself, and even allows @@ -152,18 +151,17 @@ For more information, refer to the This algorithm is an implementation of the strategy proposed in `Jeurissen et al. (2014) `__ -to estimate multi b-value (multi-shell) response functions of -single-fibre white matter (*anisotropic*), grey matter and CSF -(both *isotropic*), which can subsequently be used for multi-tissue -(constrained) spherical deconvolution. The algorithm is primarily -driven by a prior ('5TT') tissue segmentation, typically obtained -from a spatially aligned anatomical image. This also requires correction -for susceptibility-induced (EPI) distortions of the DWI dataset. -The algorithm selects voxels with a segmentation partial volume of at -least 0.95 for each tissue type. Grey matter and CSF are further -constrained by an (upper) 0.2 FA threshold. A notable difference between -this implementation and the algorithm described in `Jeurissen et al. (2014) -`__ +to estimate multi b-value response functions of single-fibre +white matter (*anisotropic*), grey matter and CSF( both *isotropic*), +which can subsequently be used for multi-tissue (constrained) spherical +deconvolution. The algorithm is primarily driven by a prior ('5TT') +tissue segmentation, typically obtained from a spatially aligned anatomical +image. This also requires prior correction for susceptibility-induced (EPI) +distortions of the DWI dataset. The algorithm selects voxels with a +segmentation partial volume of at least 0.95 for each tissue type. +Grey matter and CSF are further constrained by an (upper) 0.2 FA threshold. +A notable difference between this implementation and the algorithm described in +`Jeurissen et al. (2014) `__ is the criterium to extract single-fibre voxels from the white matter segmentation: this implementation calls upon the ``tournier`` algorithm to do so, while the paper uses a simple (lower) 0.7 FA threshold. @@ -182,8 +180,8 @@ single-fibre white matter, which can subsequently be used for single-tissue performing CSD and estimating a response function from all voxels detected as being 'single-fibre' from the CSD result itself. The criterium for a voxel to be 'single-fibre' is based on the ratio of the amplitude of -second tallest to the first tallest peak. The method is initialised with -a 'fat' response function; i.e., a response function that is safely deemed +second tallest to the tallest peak. The method is initialised with a +'fat' response function; i.e., a response function that is safely deemed to be much less 'sharp' than the true response function. This algorithm has occasionally been found to behave unstable and converge @@ -214,7 +212,7 @@ between this implementation and the algorithm described in `Tournier et al. (201 - This implementation uses a more complex metric to measure how 'single-fibre' FODs are: ``sqrt(|peak1|) * (1 - |peak2| / |peak1|)^2``, - as opposed to a simple ratio of the tallest peaks. This new metric has + as opposed to a simple ratio of the two tallest peaks. This new metric has a bias towards FODs with a larger tallest peak, to avoid favouring small, yet low SNR, FODs. @@ -232,7 +230,7 @@ between the ``tournier`` and ``tax`` algorithms include: - This implementation of the ``tournier`` algorithm uses a more complex metric to measure how 'single-fibre' FODs are (see above), while the - ``tax`` algorithm uses a simple ratio of the tallest peaks. + ``tax`` algorithm uses a simple ratio of the two tallest peaks. - The ``tournier`` algorithm estimates the response function at each iteration only from the 300 *best* 'single-fibre' voxels, while the @@ -247,10 +245,3 @@ and `here `__). For more information, refer to the :ref:`tournier algorithm documentation `. -Writing your own algorithms ---------------------------- - -TODO: Thijs is working on this documentation section. Will suggest ``manual`` -as a first (easier) option, and (python) implementation of a ``dwi2response`` -algorithm as another (and mention in which folder the algos sit). - From 9e4d4572d068d55e049ab8b48d21558d7f194a06 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Fri, 15 Dec 2017 17:06:55 +1100 Subject: [PATCH 269/538] finalising response function estimation documentation update --- .../response_function_estimation.rst | 41 ++++++++++++++++--- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/docs/constrained_spherical_deconvolution/response_function_estimation.rst b/docs/constrained_spherical_deconvolution/response_function_estimation.rst index e3ed03ba88..5465d9ade1 100644 --- a/docs/constrained_spherical_deconvolution/response_function_estimation.rst +++ b/docs/constrained_spherical_deconvolution/response_function_estimation.rst @@ -5,7 +5,7 @@ Response function estimation A prerequisite for spherical deconvolution is obtaining (the) response function(s), which is/are used as the kernel(s) by the deconvolution -algorithm. For the white matter, the response function is the signal +algorithm. For the white matter, the response function models the signal expected for a voxel containing a single, coherently oriented bundle of axons. In case of multi-tissue variants of spherical deconvolution, response functions of other tissue types are introduced as well; @@ -105,7 +105,26 @@ The following sections provide more details on each algorithm specifically. 'dhollander' algorithm ^^^^^^^^^^^^^^^^^^^^^^ -TODO: Thijs is working on this documentation section. +This algorithm is the original implementation of the strategy proposed in +`Dhollander et al. (2016) `__ +to estimate multi b-value (single-shell + b=0, or multi-shell) response +functions of single-fibre white matter (*anisotropic*), grey matter +and CSF (both *isotropic*), which can subsequently be used for +multi-tissue (constrained) spherical deconvolution algorithms. +This is an unsupervised algorithm that only requires the diffusion +weighted dataset as input. It leverages the relative diffusion properties +of the 3 tissue response functions with respect to each other, allowing it +to select the best voxels to estimate the response functions from. + +The algorithm has been succesfully tested in a wide range of conditions +(overall data quality, pathology, developmental state of the subjects, +animal data and ex-vivo data). In almost all cases, it runs and performs +well out of the box. In exceptional cases where the anisotropy in the +data is particularly low (*very* early development, ex-vivo data with low +b-value, ...), it may be advisable to set the ``-fa`` parameter lower +than its default value (of 0.2). As always, check the ``-voxels`` option +output in unusually (challenging) cases. + For more information, refer to the :ref:`dhollander algorithm documentation `. @@ -149,9 +168,9 @@ For more information, refer to the 'msmt_5tt' algorithm ^^^^^^^^^^^^^^^^^^^^ -This algorithm is an implementation of the strategy proposed in +This algorithm is a reimplementation of the strategy proposed in `Jeurissen et al. (2014) `__ -to estimate multi b-value response functions of single-fibre +to estimate multi b-value response functions of single-fibre white matter (*anisotropic*), grey matter and CSF( both *isotropic*), which can subsequently be used for multi-tissue (constrained) spherical deconvolution. The algorithm is primarily driven by a prior ('5TT') @@ -166,6 +185,16 @@ is the criterium to extract single-fibre voxels from the white matter segmentation: this implementation calls upon the ``tournier`` algorithm to do so, while the paper uses a simple (lower) 0.7 FA threshold. +Due to the challenge of accurately aligning an anatomical image (e.g. +T1-weighted image) with the diffusion data, including correction for distortions +up to an accuracy on the order of magnitude of the spatial resolution of +the anatomical image, as well as accurate spatial segmentation, this +algorithm has more prerequisites than the ``dhollander`` algorithm. +Furthermore, this algorithm was found to be *less* accurate than the +``dhollander`` algorithm. +See `Dhollander et al. (2016) `__ +for more information on this topic. + For more information, refer to the :ref:`msmt_5tt algorithm documentation `. @@ -197,13 +226,13 @@ For more information, refer to the 'tournier' algorithm ^^^^^^^^^^^^^^^^^^^^ -This algorithm is an implementation of the iterative approach proposed in +This algorithm is a reimplementation of the iterative approach proposed in `Tournier et al. (2013) `__ to estimate a single b-value (single-shell) response function of single-fibre white matter, which can subsequently be used for single-tissue (constrained) spherical deconvolution. The algorithm iterates between performing CSD and estimating a response function from a set of the best -'single-fibre' voxels as detected from the CSD result itself. Notable differences +'single-fibre' voxels, as detected from the CSD result itself. Notable differences between this implementation and the algorithm described in `Tournier et al. (2013) `__ include: From 562da9d272a659c4468add5ff42a4af51d1be7c1 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 15 Dec 2017 17:10:38 +1100 Subject: [PATCH 270/538] app.debug(): Fix for Python < 3.5 --- lib/mrtrix3/app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index 2f7557dec7..dd4568193d 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -291,7 +291,10 @@ def debug(text): #pylint: disable=unused-variable nearest = outer_frames[1] try: if len(outer_frames) == 2: # debug() called directly from script being executed - origin = '(' + os.path.basename(nearest.filename) + ':' + str(nearest.lineno) + ')' + try: + origin = '(' + os.path.basename(nearest.filename) + ':' + str(nearest.lineno) + ')' + except: + origin = '(' + os.path.basename(nearest[1]) + ':' + str(nearest[2]) + ')' else: # Some function has called debug(): Get location of both that function, and where that function was invoked try: filename = nearest.filename From 467699fc08d085096027f6d7f8dc10d5de7206d0 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 15 Dec 2017 18:24:38 +1100 Subject: [PATCH 271/538] Scripts: More compatibility fixes - Fix for Python < 3.5 accessing frames propagated to other areas of code. - Fix for run.command() using os.setpgrp(), which is not guaranteed to be defined. --- lib/mrtrix3/app.py | 6 +++--- lib/mrtrix3/run.py | 21 ++++++++++++++++++--- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index dd4568193d..81939c4682 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -293,7 +293,7 @@ def debug(text): #pylint: disable=unused-variable if len(outer_frames) == 2: # debug() called directly from script being executed try: origin = '(' + os.path.basename(nearest.filename) + ':' + str(nearest.lineno) + ')' - except: + except AttributeError: # Prior to Python 3.5 origin = '(' + os.path.basename(nearest[1]) + ':' + str(nearest[2]) + ')' else: # Some function has called debug(): Get location of both that function, and where that function was invoked try: @@ -309,7 +309,7 @@ def debug(text): #pylint: disable=unused-variable caller = outer_frames[2] try: origin += ' (from ' + os.path.basename(caller.filename) + ':' + str(caller.lineno) + ')' - except: # Prior to Python 3.5 + except AttributeError: origin += ' (from ' + os.path.basename(caller[1]) + ':' + str(caller[2]) + ')' finally: del caller @@ -338,7 +338,7 @@ def var(*variables): #pylint: disable=unused-variable calling_code = calling_frame.code_context[0] filename = calling_frame.filename lineno = calling_frame.lineno - except: # Prior to Python 3.5 + except AttributeError: # Prior to Python 3.5 calling_code = calling_frame[4][0] filename = calling_frame[1] lineno = calling_frame[2] diff --git a/lib/mrtrix3/run.py b/lib/mrtrix3/run.py index 5bdfa89ff4..85c2590699 100644 --- a/lib/mrtrix3/run.py +++ b/lib/mrtrix3/run.py @@ -106,7 +106,10 @@ def command(cmd, exitOnError=True): #pylint: disable=unused-variable handle_err = file_err.fileno() # Set off the processes try: - process = subprocess.Popen (to_execute, stdin=handle_in, stdout=handle_out, stderr=handle_err, preexec_fn=os.setpgrp) + try: + process = subprocess.Popen (to_execute, stdin=handle_in, stdout=handle_out, stderr=handle_err, preexec_fn=os.setpgrp) + except AttributeError: + process = subprocess.Popen (to_execute, stdin=handle_in, stdout=handle_out, stderr=handle_err) _processes.append(process) tempfiles.append( ( file_out, file_err ) ) # FileNotFoundError not defined in Python 2.7 @@ -190,7 +193,13 @@ def command(cmd, exitOnError=True): #pylint: disable=unused-variable caller = inspect.getframeinfo(inspect.stack()[1][0]) script_name = os.path.basename(sys.argv[0]) app.console('') - sys.stderr.write(script_name + ': ' + app.colourError + '[ERROR] Command failed: ' + cmd + app.colourClear + app.colourDebug + ' (' + os.path.basename(caller.filename) + ':' + str(caller.lineno) + ')' + app.colourClear + '\n') + try: + filename = caller.filename + lineno = caller.lineno + except AttributeError: + filename = caller[1] + lineno = caller[2] + sys.stderr.write(script_name + ': ' + app.colourError + '[ERROR] Command failed: ' + cmd + app.colourClear + app.colourDebug + ' (' + os.path.basename(filename) + ':' + str(lineno) + ')' + app.colourClear + '\n') sys.stderr.write(script_name + ': ' + app.colourConsole + 'Output of failed command:' + app.colourClear + '\n') for line in error_text.splitlines(): sys.stderr.write(' ' * (len(script_name)+2) + line + '\n') @@ -247,7 +256,13 @@ def function(fn, *args): #pylint: disable=unused-variable error_text = str(type(e).__name__) + ': ' + str(e) script_name = os.path.basename(sys.argv[0]) app.console('') - sys.stderr.write(script_name + ': ' + app.colourError + '[ERROR] Function failed: ' + fnstring + app.colourClear + app.colourDebug + ' (' + os.path.basename(caller.filename) + ':' + str(caller.lineno) + ')' + app.colourClear + '\n') + try: + filename = caller.filename + lineno = caller.lineno + except AttributeError: + filename = caller[1] + lineno = caller[2] + sys.stderr.write(script_name + ': ' + app.colourError + '[ERROR] Function failed: ' + fnstring + app.colourClear + app.colourDebug + ' (' + os.path.basename(filename) + ':' + str(lineno) + ')' + app.colourClear + '\n') sys.stderr.write(script_name + ': ' + app.colourConsole + 'Information from failed function:' + app.colourClear + '\n') for line in error_text.splitlines(): sys.stderr.write(' ' * (len(script_name)+2) + line + '\n') From 24d2bfe3c3513fd04d9a27e2ae6891e0c2c5a1eb Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 15 Dec 2017 18:28:00 +1100 Subject: [PATCH 272/538] average_response: Bug fix Issue introduced in #1098. Duplication of list rows using the '*' operator duplicates references to the first line, not duplicates of the first line contents; hence modifications to any line are duplicated across all lines. Closes #1216. --- bin/average_response | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/average_response b/bin/average_response index 10e455a867..92f514a05f 100755 --- a/bin/average_response +++ b/bin/average_response @@ -32,7 +32,8 @@ for i in range(1, num_subjects + 1): sys.stdout.write("Number of b-values: " + str(num_bvals) + '\n') -average_response = [[0] * num_coeff] * num_bvals +# Can't use multiplication operator in outer loop since it duplicates by reference rather than value +average_response = [[0] * num_coeff for _ in range(num_bvals)] for i in range(1, num_subjects + 1): with open(sys.argv[i], 'r') as f: lines = f.readlines() From da8bfa23664e331e7f3ae2814757824be5e88c86 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 15 Dec 2017 20:40:34 +1100 Subject: [PATCH 273/538] average_response: Fix erroneous pylint warning --- bin/average_response | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/average_response b/bin/average_response index 92f514a05f..e2f1a4504e 100755 --- a/bin/average_response +++ b/bin/average_response @@ -33,7 +33,7 @@ for i in range(1, num_subjects + 1): sys.stdout.write("Number of b-values: " + str(num_bvals) + '\n') # Can't use multiplication operator in outer loop since it duplicates by reference rather than value -average_response = [[0] * num_coeff for _ in range(num_bvals)] +average_response = [[0] * num_coeff for _ in range(num_bvals)] #pylint: disable=unused-variable for i in range(1, num_subjects + 1): with open(sys.argv[i], 'r') as f: lines = f.readlines() From b3766bd705eb6471ff0433936320423c205f7bea Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Mon, 18 Dec 2017 11:17:32 +1100 Subject: [PATCH 274/538] Rounding up the final bits. --- bin/dwigradcheck | 3 +-- bin/population_template | 2 +- docs/reference/commands/amp2response.rst | 2 +- docs/reference/commands/amp2sh.rst | 2 +- docs/reference/commands/dirstat.rst | 2 +- docs/reference/commands/dwi2fod.rst | 2 +- docs/reference/commands/dwiextract.rst | 2 +- src/dwi/shells.cpp | 14 +++++++++----- 8 files changed, 16 insertions(+), 13 deletions(-) diff --git a/bin/dwigradcheck b/bin/dwigradcheck index cb179ed2e7..441699dbe2 100755 --- a/bin/dwigradcheck +++ b/bin/dwigradcheck @@ -100,8 +100,7 @@ if not os.path.exists('mask.mif'): number_option = ' -select ' + str(app.args.number) -# -# TODO What variations of gradient errors can we conceive? +# What variations of gradient errors can we conceive? # Done: # * Has an axis been flipped? (none, 0, 1, 2) diff --git a/bin/population_template b/bin/population_template index 29165d8aca..234e0515db 100755 --- a/bin/population_template +++ b/bin/population_template @@ -44,7 +44,7 @@ except ImportError: app.console("numpy not found; using replacement functions") def loadtxt(fname, delimiter=" ", dtype=float): with open(fname, "rb") as f: - return [[dtype(x) for x in l.decode(errors='ignore').rstrip().split(delimiter)] for l in f.readlines()] + return [[dtype(a) for a in l.decode(errors='ignore').rstrip().split(delimiter)] for l in f.readlines()] def savetxt(fname, X, delimiter=" ", fmt="%.14e"): try: diff --git a/docs/reference/commands/amp2response.rst b/docs/reference/commands/amp2response.rst index cd27f976ba..1467ead95a 100644 --- a/docs/reference/commands/amp2response.rst +++ b/docs/reference/commands/amp2response.rst @@ -41,7 +41,7 @@ Options DW shell selection options ^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shells list** specify one or more diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. +- **-shells b-values** specify one or more b-values to use during processing, as a comma-separated list of the desired approximate b-values (b-values are clustered to allow for small deviations). Note that some commands are incompatible with multiple b-values, and will report an error if more than one b-value is provided. WARNING: note that, even though the b=0 volumes are never referred to as shells in the literature, they still have to be explicitly included in the list of b-values as provided to the -shell option! Several algorithms which include the b=0 volumes in their computations may otherwise return an undesired result. - **-lmax values** specify the maximum harmonic degree of the response function to estimate (can be a comma-separated list for multi-shell data) diff --git a/docs/reference/commands/amp2sh.rst b/docs/reference/commands/amp2sh.rst index 231c0a14a0..d11895bbff 100644 --- a/docs/reference/commands/amp2sh.rst +++ b/docs/reference/commands/amp2sh.rst @@ -50,7 +50,7 @@ DW gradient table import options DW shell selection options ^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shells list** specify one or more diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. +- **-shells b-values** specify one or more b-values to use during processing, as a comma-separated list of the desired approximate b-values (b-values are clustered to allow for small deviations). Note that some commands are incompatible with multiple b-values, and will report an error if more than one b-value is provided. WARNING: note that, even though the b=0 volumes are never referred to as shells in the literature, they still have to be explicitly included in the list of b-values as provided to the -shell option! Several algorithms which include the b=0 volumes in their computations may otherwise return an undesired result. Stride options ^^^^^^^^^^^^^^ diff --git a/docs/reference/commands/dirstat.rst b/docs/reference/commands/dirstat.rst index a1bca50de3..466588ccba 100644 --- a/docs/reference/commands/dirstat.rst +++ b/docs/reference/commands/dirstat.rst @@ -48,7 +48,7 @@ Options DW shell selection options ^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shells list** specify one or more diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. +- **-shells b-values** specify one or more b-values to use during processing, as a comma-separated list of the desired approximate b-values (b-values are clustered to allow for small deviations). Note that some commands are incompatible with multiple b-values, and will report an error if more than one b-value is provided. WARNING: note that, even though the b=0 volumes are never referred to as shells in the literature, they still have to be explicitly included in the list of b-values as provided to the -shell option! Several algorithms which include the b=0 volumes in their computations may otherwise return an undesired result. DW gradient table import options ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/reference/commands/dwi2fod.rst b/docs/reference/commands/dwi2fod.rst index c1e76a2095..e2e684890e 100644 --- a/docs/reference/commands/dwi2fod.rst +++ b/docs/reference/commands/dwi2fod.rst @@ -39,7 +39,7 @@ DW gradient table import options DW shell selection options ^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shells list** specify one or more diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. +- **-shells b-values** specify one or more b-values to use during processing, as a comma-separated list of the desired approximate b-values (b-values are clustered to allow for small deviations). Note that some commands are incompatible with multiple b-values, and will report an error if more than one b-value is provided. WARNING: note that, even though the b=0 volumes are never referred to as shells in the literature, they still have to be explicitly included in the list of b-values as provided to the -shell option! Several algorithms which include the b=0 volumes in their computations may otherwise return an undesired result. Options common to more than one algorithm ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/reference/commands/dwiextract.rst b/docs/reference/commands/dwiextract.rst index f73fa8151d..7951dd985c 100644 --- a/docs/reference/commands/dwiextract.rst +++ b/docs/reference/commands/dwiextract.rst @@ -39,7 +39,7 @@ DW gradient table import options DW shell selection options ^^^^^^^^^^^^^^^^^^^^^^^^^^ -- **-shells list** specify one or more diffusion-weighted gradient shells to use during processing, as a comma-separated list of the desired approximate b-values. Note that some commands are incompatible with multiple shells, and will throw an error if more than one b-value is provided. +- **-shells b-values** specify one or more b-values to use during processing, as a comma-separated list of the desired approximate b-values (b-values are clustered to allow for small deviations). Note that some commands are incompatible with multiple b-values, and will report an error if more than one b-value is provided. WARNING: note that, even though the b=0 volumes are never referred to as shells in the literature, they still have to be explicitly included in the list of b-values as provided to the -shell option! Several algorithms which include the b=0 volumes in their computations may otherwise return an undesired result. Options for importing phase-encode tables ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/dwi/shells.cpp b/src/dwi/shells.cpp index ddb6587031..54ecccef97 100644 --- a/src/dwi/shells.cpp +++ b/src/dwi/shells.cpp @@ -27,11 +27,15 @@ namespace MR const App::OptionGroup ShellsOption = App::OptionGroup ("DW shell selection options") + App::Option ("shells", - "specify one or more diffusion-weighted gradient shells to use during " - "processing, as a comma-separated list of the desired approximate b-values. " - "Note that some commands are incompatible with multiple shells, and " - "will throw an error if more than one b-value is provided.") - + App::Argument ("list").type_sequence_float(); + "specify one or more b-values to use during processing, as a comma-separated list " + "of the desired approximate b-values (b-values are clustered to allow for small " + "deviations). Note that some commands are incompatible with multiple b-values, " + "and will report an error if more than one b-value is provided. \n" + "WARNING: note that, even though the b=0 volumes are never referred to as shells " + "in the literature, they still have to be explicitly included in the list of " + "b-values as provided to the -shell option! Several algorithms which include the " + "b=0 volumes in their computations may otherwise return an undesired result.") + + App::Argument ("b-values").type_sequence_float(); From 5851d4d8379577bcf716e6603cd1df5459a93d79 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Mon, 18 Dec 2017 13:58:11 +1100 Subject: [PATCH 275/538] pylint.log appeared twice --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e4de6291f4..d0023583fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,6 @@ after_failure: - cat memalign.log - cat configure.log - cat build.log - - cat pylint.log - cat testing.log - cat pylint.log - cat gitdiff.log From b54c55a7e43c9007f4a6265387e03c29622ce996 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Mon, 18 Dec 2017 14:15:00 +1100 Subject: [PATCH 276/538] allow iterating with range and length --- testing/pylint.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/pylint.rc b/testing/pylint.rc index ef47754d67..befa469c38 100644 --- a/testing/pylint.rc +++ b/testing/pylint.rc @@ -48,7 +48,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" #disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call -disable=invalid-name,line-too-long,bad-whitespace,multiple-imports,wrong-import-position,missing-docstring,global-statement,bare-except,too-many-branches,arguments-differ,too-many-statements,too-many-nested-blocks,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-lines +disable=invalid-name,line-too-long,bad-whitespace,multiple-imports,wrong-import-position,missing-docstring,global-statement,bare-except,too-many-branches,arguments-differ,too-many-statements,too-many-nested-blocks,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-lines,consider-using-enumerate # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option From 8bb9eb9a3f9191e63b98288a821fef9fb3f31023 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Mon, 18 Dec 2017 14:24:43 +1100 Subject: [PATCH 277/538] deal with 'inconsistent-return-statements' --- lib/mrtrix3/fsl.py | 2 +- lib/mrtrix3/run.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/mrtrix3/fsl.py b/lib/mrtrix3/fsl.py index d8709fffb8..7a46b8fb89 100644 --- a/lib/mrtrix3/fsl.py +++ b/lib/mrtrix3/fsl.py @@ -71,7 +71,7 @@ def exeName(name): #pylint: disable=unused-variable # FSL commands will generate based on the suffix() function, the FSL binaries themselves # ignore the FSLOUTPUTTYPE environment variable. Therefore, the safest approach is: # Whenever receiving an output image from an FSL command, explicitly search for the path -def findImage(name): #pylint: disable=unused-variable +def findImage(name): #pylint: disable=unused-variable,inconsistent-return-statements import os from mrtrix3 import app prefix = os.path.join(os.path.dirname(name), os.path.basename(name).split('.')[0]) diff --git a/lib/mrtrix3/run.py b/lib/mrtrix3/run.py index 85c2590699..dc5f76d89d 100644 --- a/lib/mrtrix3/run.py +++ b/lib/mrtrix3/run.py @@ -15,7 +15,7 @@ def setContinue(filename): #pylint: disable=unused-variable -def command(cmd, exitOnError=True): #pylint: disable=unused-variable +def command(cmd, exitOnError=True): #pylint: disable=unused-variable,inconsistent-return-statements import inspect, itertools, shlex, signal, string, subprocess, sys, tempfile from distutils.spawn import find_executable @@ -226,7 +226,7 @@ def command(cmd, exitOnError=True): #pylint: disable=unused-variable -def function(fn, *args): #pylint: disable=unused-variable +def function(fn, *args): #pylint: disable=unused-variable,inconsistent-return-statements import inspect, sys from mrtrix3 import app @@ -318,7 +318,7 @@ def exeName(item): # or a non-MRtrix3 command with the same name as an MRtrix3 command # (e.g. C:\Windows\system32\mrinfo.exe; On Windows, subprocess uses CreateProcess(), # which checks system32\ before PATH) -def versionMatch(item): +def versionMatch(item): #pylint: disable=inconsistent-return-statements from distutils.spawn import find_executable from mrtrix3 import app global _mrtrix_bin_path, _mrtrix_exe_list From 211584033e962312c671d3bfe8f981badb6977b6 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Mon, 18 Dec 2017 15:25:23 +1100 Subject: [PATCH 278/538] Keeping Sphinx happy, apparently. --- docs/concepts/pe_scheme.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/concepts/pe_scheme.rst b/docs/concepts/pe_scheme.rst index 705e2b9876..971f187557 100644 --- a/docs/concepts/pe_scheme.rst +++ b/docs/concepts/pe_scheme.rst @@ -119,7 +119,7 @@ image data in such a way as to invalidate the phase encoding information will modifying the representation of this information between the fixed and variable phase encoding cases. -Consider, for instance, a pair of *b*=0 images, where the first was acquired with +Consider, for instance, a pair of b=0 images, where the first was acquired with phase encoding direction ``A>>P``, and the second was acquired using phase encoding direction ``P>>A``:: From 098ebc0e6423ef679b45b742bd2d25138c538664 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Mon, 18 Dec 2017 16:10:05 +1100 Subject: [PATCH 279/538] battle with the sphinx --- docs/troubleshooting/performance_and_crashes.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/troubleshooting/performance_and_crashes.rst b/docs/troubleshooting/performance_and_crashes.rst index 4697801c02..aa63855e4d 100644 --- a/docs/troubleshooting/performance_and_crashes.rst +++ b/docs/troubleshooting/performance_and_crashes.rst @@ -37,8 +37,6 @@ by restricting the number of threads to be used during compilation: $ NUMBER_OF_PROCESSORS=1 ./build -.. _crash_RAM: - .. _crash_ram: Commands crashing due to memory requirements From 513223cc5a4777fa6ba64a3a65f7960504fe80a2 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Mon, 18 Dec 2017 16:16:25 +1100 Subject: [PATCH 280/538] sphinx :| --- docs/concepts/pe_scheme.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/concepts/pe_scheme.rst b/docs/concepts/pe_scheme.rst index 971f187557..a7e88a7d6d 100644 --- a/docs/concepts/pe_scheme.rst +++ b/docs/concepts/pe_scheme.rst @@ -30,7 +30,7 @@ The phase encoding information for a particular image file can be stored in one of two ways. - The most convenient of these is storage of (one or more) key-value field(s) - encapsulated within the :ref:`image_header`, just as can be used for + encapsulated within the image header, just as can be used for :ref:`diffusion_gradient_scheme_handling`. This ensures that the information is retained through image processing, as each *MRtrix3* command passes the header entries of the input image through to the output image. From dc9185483caccdf2e3a57a73d8333892d9886032 Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Mon, 18 Dec 2017 16:23:12 +1100 Subject: [PATCH 281/538] sphinx.. --- docs/concepts/pe_scheme.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/concepts/pe_scheme.rst b/docs/concepts/pe_scheme.rst index a7e88a7d6d..2c0644fce9 100644 --- a/docs/concepts/pe_scheme.rst +++ b/docs/concepts/pe_scheme.rst @@ -31,7 +31,7 @@ of two ways. - The most convenient of these is storage of (one or more) key-value field(s) encapsulated within the image header, just as can be used for - :ref:`diffusion_gradient_scheme_handling`. This ensures that the information + the diffusion gradient scheme. This ensures that the information is retained through image processing, as each *MRtrix3* command passes the header entries of the input image through to the output image. @@ -96,7 +96,7 @@ If the phase encoding direction and/or the total readout time varies between different volumes within a single image series, then the two key-value fields described above are not sufficient to fully encode this information. In this situation, *MRtrix3* will instead use a key-value entry "``pe_scheme``" (similar to -the "``dw_scheme``" entry used for :ref:`diffusion_gradient_scheme_handling`). +the "``dw_scheme``" entry used for the diffusion gradient scheme). This information is stored as a *table*, where each row contains the phase encoding direction and the readout time for the corresponding volume; the number of rows in From 58bb181d9067d5c9d6428513395bd79422303aaf Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 20 Dec 2017 14:07:16 +1100 Subject: [PATCH 282/538] Fix merge issues: 'fsl_checkfirst_function' to 'dev' Also solves issues of inconsistent return statements reported by newer versions of pylint, reverting 8bb9eb9a merged in #1211. --- lib/mrtrix3/_5ttgen/fsl.py | 2 +- lib/mrtrix3/app.py | 1 - lib/mrtrix3/fsl.py | 3 ++- lib/mrtrix3/run.py | 11 ++++++----- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/mrtrix3/_5ttgen/fsl.py b/lib/mrtrix3/_5ttgen/fsl.py index da5f749600..d6070c3ea7 100644 --- a/lib/mrtrix3/_5ttgen/fsl.py +++ b/lib/mrtrix3/_5ttgen/fsl.py @@ -35,7 +35,7 @@ def getInputs(): #pylint: disable=unused-variable def execute(): #pylint: disable=unused-variable import math, os - from mrtrix3 import app, file, fsl, image, path, run #pylint: disable=redefined-builtin + from mrtrix3 import app, fsl, image, run if app.isWindows(): app.error('\'fsl\' algorithm of 5ttgen script cannot be run on Windows: FSL not available on Windows') diff --git a/lib/mrtrix3/app.py b/lib/mrtrix3/app.py index 7447cc5c79..32844f474d 100644 --- a/lib/mrtrix3/app.py +++ b/lib/mrtrix3/app.py @@ -867,7 +867,6 @@ def done(self): import sys global verbosity global clearLine, colourConsole, colourClear, colourExec - self.counter = self.target self.iscomplete = True self.value = 100 if self.isatty: diff --git a/lib/mrtrix3/fsl.py b/lib/mrtrix3/fsl.py index 21376a39e3..43f2e1d9d9 100644 --- a/lib/mrtrix3/fsl.py +++ b/lib/mrtrix3/fsl.py @@ -89,7 +89,7 @@ def exeName(name): #pylint: disable=unused-variable # FSL commands will generate based on the suffix() function, the FSL binaries themselves # ignore the FSLOUTPUTTYPE environment variable. Therefore, the safest approach is: # Whenever receiving an output image from an FSL command, explicitly search for the path -def findImage(name): #pylint: disable=unused-variable,inconsistent-return-statements +def findImage(name): #pylint: disable=unused-variable import os from mrtrix3 import app prefix = os.path.join(os.path.dirname(name), os.path.basename(name).split('.')[0]) @@ -101,6 +101,7 @@ def findImage(name): #pylint: disable=unused-variable,inconsistent-return-statem app.debug('Expected image at \"' + prefix + suffix() + '\", but found at \"' + prefix + suf + '\"') return prefix + suf app.error('Unable to find FSL output file for path \"' + name + '\"') + return '' diff --git a/lib/mrtrix3/run.py b/lib/mrtrix3/run.py index 6e235ec741..c0c6d82a55 100644 --- a/lib/mrtrix3/run.py +++ b/lib/mrtrix3/run.py @@ -23,7 +23,7 @@ def setContinue(filename): #pylint: disable=unused-variable -def command(cmd, exitOnError=True): #pylint: disable=unused-variable,inconsistent-return-statements +def command(cmd, exitOnError=True): #pylint: disable=unused-variable import inspect, itertools, shlex, signal, string, subprocess, sys, tempfile from distutils.spawn import find_executable @@ -41,7 +41,7 @@ def command(cmd, exitOnError=True): #pylint: disable=unused-variable,inconsisten if app.verbosity: sys.stderr.write(app.colourExec + 'Skipping command:' + app.colourClear + ' ' + cmd + '\n') sys.stderr.flush() - return + return ('', '') # This splits the command string based on the piping character '|', such that each # individual executable (along with its arguments) appears as its own list @@ -235,7 +235,7 @@ def command(cmd, exitOnError=True): #pylint: disable=unused-variable,inconsisten -def function(fn, *args): #pylint: disable=unused-variable,inconsistent-return-statements +def function(fn, *args): #pylint: disable=unused-variable import inspect, sys from mrtrix3 import app @@ -248,7 +248,7 @@ def function(fn, *args): #pylint: disable=unused-variable,inconsistent-return-st if app.verbosity: sys.stderr.write(app.colourExec + 'Skipping function:' + app.colourClear + ' ' + fnstring + '\n') sys.stderr.flush() - return + return None if app.verbosity: sys.stderr.write(app.colourExec + 'Function:' + app.colourClear + ' ' + fnstring + '\n') @@ -327,7 +327,7 @@ def exeName(item): # or a non-MRtrix3 command with the same name as an MRtrix3 command # (e.g. C:\Windows\system32\mrinfo.exe; On Windows, subprocess uses CreateProcess(), # which checks system32\ before PATH) -def versionMatch(item): #pylint: disable=inconsistent-return-statements +def versionMatch(item): from distutils.spawn import find_executable from mrtrix3 import app global _mrtrix_bin_path, _mrtrix_exe_list @@ -347,6 +347,7 @@ def versionMatch(item): #pylint: disable=inconsistent-return-statements return exe_path_sys app.error('Unable to find executable for MRtrix3 command ' + item) + return '' From 39124acbc166f7dea0852146085485c422ed5bbf Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 20 Dec 2017 15:57:27 +1100 Subject: [PATCH 283/538] Python: Fix pylint consider-using-enumerate Rather than disabling this Pylint warning, instead use more Pythoninc approaches where warnings were issued. Reverts b54c55a7 committed to dev in #1211. --- bin/convert_bruker | 9 +-- bin/population_template | 129 ++++++++++++++++---------------- lib/mrtrix3/dwi2response/tax.py | 6 +- testing/pylint.rc | 2 +- 4 files changed, 73 insertions(+), 73 deletions(-) diff --git a/bin/convert_bruker b/bin/convert_bruker index e789e5adcc..ecd39f9253 100755 --- a/bin/convert_bruker +++ b/bin/convert_bruker @@ -114,10 +114,9 @@ with open (sys.argv[2], 'w') as f: f.write ('\nfile: ' + sys.argv[1] + '\n') try: - #pylint: disable=pointless-statement - bvec - bval - for n in range (0, len (bval)): - f.write ('dw_scheme: ' + bvec[3*n] + ',' + bvec[3*n+1] + ',' + str(-float(bvec[3*n+2])) + ',' + bval[n] + '\n') + assert len(bvec) == 3*len(bval) + bvec = [ bvec[n:n+3] for n in range(0,len(bval),3) ] + for direction, value in zip(bvec, bval): + f.write ('dw_scheme: ' + direction[0] + ',' + direction[1] + ',' + str(-float(direction[2])) + ',' + value + '\n') except: pass diff --git a/bin/population_template b/bin/population_template index 234e0515db..ed74dcbe7b 100755 --- a/bin/population_template +++ b/bin/population_template @@ -383,7 +383,7 @@ if dolinear: for istage, [tpe, scale, niter] in enumerate(zip (linear_type, linear_scales, linear_niter)): app.console('(%02i) %s scale: %.4f, niter: %i, no reorientation' %(istage, tpe.ljust(9), scale, niter)) -datatype = ' -datatype float32' +datatype_option = ' -datatype float32' if not dononlinear: nl_scales = [] @@ -467,7 +467,7 @@ if useMasks: if initial_alignment == 'none': progress = app.progressBar('Resampling input images to template space with no initial alignment', len(inputs)) for i in inputs: - run.command('mrtransform ' + abspath(i.directory, i.filename) + ' -interp linear -template average_header.mif ' + os.path.join('inputs_transformed', i.prefix + '.mif') + datatype) + run.command('mrtransform ' + abspath(i.directory, i.filename) + ' -interp linear -template average_header.mif ' + os.path.join('inputs_transformed', i.prefix + '.mif') + datatype_option) progress.increment() progress.done() if not dolinear: @@ -488,17 +488,17 @@ else: ' -type rigid ' + \ ' -noreorientation ' + \ ' -rigid_init_translation ' + initial_alignment + ' ' + \ - datatype + \ + datatype_option + \ output) # translate input images to centre of mass without interpolation run.command('mrtransform ' + abspath(i.directory, i.filename) + \ ' -linear ' + os.path.join('linear_transforms_initial', i.prefix + '.txt') + \ - datatype + \ + datatype_option + \ ' ' + os.path.join('inputs_transformed', i.prefix + '_translated.mif')) if useMasks: run.command('mrtransform ' + abspath(i.mask_directory, i.mask_filename) + \ ' -linear ' + os.path.join('linear_transforms_initial', i.prefix + '.txt') + \ - datatype + ' ' + \ + datatype_option + ' ' + \ os.path.join('masks_transformed', i.prefix + '_translated.mif')) progress.increment() progress.done() @@ -517,7 +517,7 @@ else: os.path.join('masks_transformed', i.prefix + '_translated.mif') + ' ' + \ os.path.join('masks_transformed', i.prefix + '.mif') + ' ' + \ '-interp nearest -template average_header.mif' + \ - datatype) + datatype_option) progress.increment() progress.done() # crop average space to extent defined by translated masks @@ -535,7 +535,7 @@ else: os.path.join('masks_transformed', i.prefix + '_translated.mif') + ' ' + \ os.path.join('masks_transformed', i.prefix + '.mif') + ' ' + \ '-interp nearest -template average_header.mif' + \ - datatype + ' ' + \ + datatype_option + ' ' + \ '-force') run.function(remove, os.path.join('masks_transformed', i.prefix + '_translated.mif')) progress.increment() @@ -548,7 +548,7 @@ else: os.path.join('inputs_transformed', i.prefix + '_translated.mif') + ' ' + \ os.path.join('inputs_transformed', i.prefix + '.mif') + ' ' + \ '-interp linear -template average_header.mif' + \ - datatype) + datatype_option) run.function(remove, os.path.join('inputs_transformed', i.prefix + '_translated.mif')) progress.increment() progress.done() @@ -563,60 +563,60 @@ if not dolinear: for i in inputs: run.function(copy, os.path.join('linear_transforms_initial','%s.txt' % (i.prefix)), os.path.join('linear_transforms','%s.txt' % (i.prefix))) else: - for level in range(0, len(linear_scales)): + for level, (regtype, scale, niter, lmax) in enumerate(zip(linear_type, linear_scales, linear_niter, linear_lmax)): progress = app.progressBar('Optimising template with linear registration (stage {0} of {1})'.format(level+1, len(linear_scales)), len(inputs)) for i in inputs: - initialise = '' + initialise_option = '' if useMasks: - mask = ' -mask1 ' + abspath(i.mask_directory, i.mask_filename) + mask_option = ' -mask1 ' + abspath(i.mask_directory, i.mask_filename) else: - mask = '' - lmax = '' - metric = '' - mrregister_log = '' - if linear_type[level] == 'rigid': - scale = ' -rigid_scale ' + str(linear_scales[level]) - niter = ' -rigid_niter ' + str(linear_niter[level]) - regtype = ' -type rigid' - output = ' -rigid ' + os.path.join('linear_transforms_%i' % level, '%s.txt' % i.prefix) + mask_option = '' + lmax_option = '' + metric_option = '' + mrregister_log_option = '' + if regtype == 'rigid': + scale_option = ' -rigid_scale ' + str(scale) + niter_option = ' -rigid_niter ' + str(niter) + regtype_option = ' -type rigid' + output_option = ' -rigid ' + os.path.join('linear_transforms_%i' % level, '%s.txt' % i.prefix) if level > 0: - initialise = ' -rigid_init_matrix ' + os.path.join('linear_transforms_%i' % (level - 1), '%s.txt' % i.prefix) + initialise_option = ' -rigid_init_matrix ' + os.path.join('linear_transforms_%i' % (level - 1), '%s.txt' % i.prefix) if do_fod_registration: - lmax = ' -rigid_lmax ' + str(linear_lmax[level]) + lmax_option = ' -rigid_lmax ' + str(lmax) else: - lmax = ' -noreorientation' + lmax_option = ' -noreorientation' if linear_estimator: - metric = ' -rigid_metric.diff.estimator ' + linear_estimator + metric_option = ' -rigid_metric.diff.estimator ' + linear_estimator if app.verbosity >= 2: - mrregister_log = ' -info -rigid_log ' + os.path.join('log', i.filename + "_" + str(level) + '.log') + mrregister_log_option = ' -info -rigid_log ' + os.path.join('log', i.filename + "_" + str(level) + '.log') else: - scale = ' -affine_scale ' + str(linear_scales[level]) - niter = ' -affine_niter ' + str(linear_niter[level]) - regtype = ' -type affine' - output = ' -affine ' + os.path.join('linear_transforms_%i' % level, '%s.txt' % i.prefix) + scale_option = ' -affine_scale ' + str(scale) + niter_option = ' -affine_niter ' + str(niter) + regtype_option = ' -type affine' + output_option = ' -affine ' + os.path.join('linear_transforms_%i' % level, '%s.txt' % i.prefix) if level > 0: - initialise = ' -affine_init_matrix ' + os.path.join('linear_transforms_%i' % (level - 1), '%s.txt' % i.prefix) + initialise_option = ' -affine_init_matrix ' + os.path.join('linear_transforms_%i' % (level - 1), '%s.txt' % i.prefix) if do_fod_registration: - lmax = ' -affine_lmax ' + str(linear_lmax[level]) + lmax_option = ' -affine_lmax ' + str(lmax) else: - lmax = ' -noreorientation' + lmax_option = ' -noreorientation' if linear_estimator: - metric = ' -affine_metric.diff.estimator ' + linear_estimator + metric_option = ' -affine_metric.diff.estimator ' + linear_estimator if write_log: - mrregister_log = ' -info -affine_log ' + os.path.join('log', i.filename + '_' + str(level) + '.log') + mrregister_log_option = ' -info -affine_log ' + os.path.join('log', i.filename + '_' + str(level) + '.log') command = 'mrregister ' + abspath(i.directory, i.filename) + ' ' + current_template + \ ' -force' + \ - initialise + \ - mask + \ - scale + \ - niter + \ - lmax + \ - regtype + \ - metric + \ - datatype + \ - output + \ - mrregister_log + initialise_option + \ + mask_option + \ + scale_option + \ + niter_option + \ + lmax_option + \ + regtype_option + \ + metric_option + \ + datatype_option + \ + output_option + \ + mrregister_log_option run.command(command) check_linear_transformation(os.path.join('linear_transforms_%i' % level, '%s.txt' % i.prefix), command, pause_on_warn=do_pause_on_warn) progress.increment() @@ -640,7 +640,7 @@ else: '-template ' + current_template + ' ' + \ '-linear ' + os.path.join('linear_transforms_%i' % level, '%s.txt' % i.prefix) + ' ' + \ os.path.join('inputs_transformed', '%s.mif' % i.prefix) + \ - datatype + ' ' + \ + datatype_option + ' ' + \ '-force') progress.increment() progress.done() @@ -669,43 +669,44 @@ if useMasks and (dononlinear or app.args.template_mask): if dononlinear: # Optimise the template with non-linear registration file.makeDir('warps') - for level in range(0, len(nl_scales)): + for level, (scale, niter, lmax) in enumerate(zip(nl_scales, nl_niter, nl_lmax)): progress = app.progressBar('Optimising template with non-linear registration (stage {0} of {1})'.format(level+1, len(nl_scales)), len(inputs)) for i in inputs: if level > 0: - initialise = ' -nl_init ' + os.path.join('warps_%i' % (level-1), '%s.mif' % i.prefix) - scale = '' + initialise_option = ' -nl_init ' + os.path.join('warps_%i' % (level-1), '%s.mif' % i.prefix) + scale_option = '' else: - scale = ' -nl_scale ' + str(nl_scales[level]) + scale_option = ' -nl_scale ' + str(scale) if not doaffine: # rigid or no previous linear stage - initialise = ' -rigid_init_matrix ' + os.path.join('linear_transforms', '%s.txt' % i.prefix) + initialise_option = ' -rigid_init_matrix ' + os.path.join('linear_transforms', '%s.txt' % i.prefix) else: - initialise = ' -affine_init_matrix ' + os.path.join('linear_transforms', '%s.txt' % i.prefix) + initialise_option = ' -affine_init_matrix ' + os.path.join('linear_transforms', '%s.txt' % i.prefix) if useMasks: - mask = ' -mask1 ' + abspath(i.mask_directory, i.mask_filename) + ' -mask2 ' + current_template_mask + mask_option = ' -mask1 ' + abspath(i.mask_directory, i.mask_filename) + ' -mask2 ' + current_template_mask else: - mask = '' + mask_option = '' if do_fod_registration: - lmax = ' -nl_lmax ' + str(nl_lmax[level]) + lmax_option = ' -nl_lmax ' + str(lmax) else: - lmax = ' -noreorientation' + lmax_option = ' -noreorientation' run.command('mrregister ' + abspath(i.directory, i.filename) + ' ' + current_template + ' ' + \ '-type nonlinear ' + \ - '-nl_niter ' + str(nl_niter[level]) + ' ' + \ + '-nl_niter ' + str(niter) + ' ' + \ '-nl_warp_full ' + os.path.join('warps_%i' % level, '%s.mif' % i.prefix) + ' ' + \ '-transformed ' + os.path.join('inputs_transformed', '%s.mif' % i.prefix) + ' ' + \ '-nl_update_smooth ' + app.args.nl_update_smooth + ' ' + \ '-nl_disp_smooth ' + app.args.nl_disp_smooth + ' ' + \ '-nl_grad_step ' + app.args.nl_grad_step + ' ' + \ '-force' + \ - initialise + \ - scale + \ - mask + \ - datatype + \ - lmax) + initialise_option + \ + scale_option + \ + mask_option + \ + datatype_option + \ + lmax_option) + if level > 0: run.function(remove, os.path.join('warps_%i'%(level-1), '%s.mif' % i.prefix)) if useMasks: @@ -722,12 +723,12 @@ if dononlinear: current_template = 'nl_template' + str(level) + '.mif' if useMasks: - run.command ('mrmath ' + ' '.join(allindir('masks_transformed')) + ' min - | maskfilter - median - | maskfilter - dilate -npass 5 nl_template_mask' + str(level) + '.mif') + run.command('mrmath ' + ' '.join(allindir('masks_transformed')) + ' min - | maskfilter - median - | maskfilter - dilate -npass 5 nl_template_mask' + str(level) + '.mif') current_template_mask = 'nl_template_mask' + str(level) + '.mif' if level < len(nl_scales) - 1: - if nl_scales[level] < nl_scales[level + 1]: - upsample_factor = nl_scales[level + 1] / nl_scales[level] + if scale < nl_scales[level + 1]: + upsample_factor = nl_scales[level + 1] / scale for i in inputs: run.command('mrresize ' + os.path.join('warps_%i' % level, '%s.mif' % i.prefix) + ' -scale %f tmp.mif' % upsample_factor) run.function(move, 'tmp.mif', os.path.join('warps_' + str(level), '%s.mif' % i.prefix)) diff --git a/lib/mrtrix3/dwi2response/tax.py b/lib/mrtrix3/dwi2response/tax.py index 836bbd2b47..fe34dc4adb 100644 --- a/lib/mrtrix3/dwi2response/tax.py +++ b/lib/mrtrix3/dwi2response/tax.py @@ -98,9 +98,9 @@ def execute(): #pylint: disable=unused-variable with open(prefix + 'RF.txt', 'r') as new_RF_file: new_RF = [ float(x) for x in new_RF_file.read().split() ] reiterate = False - for index in range(0, len(old_RF)): - mean = 0.5 * (old_RF[index] + new_RF[index]) - diff = math.fabs(0.5 * (old_RF[index] - new_RF[index])) + for old_value, new_value in zip(old_RF, new_RF): + mean = 0.5 * (old_value + new_value) + diff = math.fabs(0.5 * (old_value - new_value)) ratio = diff / mean if ratio > convergence_change: reiterate = True diff --git a/testing/pylint.rc b/testing/pylint.rc index befa469c38..ef47754d67 100644 --- a/testing/pylint.rc +++ b/testing/pylint.rc @@ -48,7 +48,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" #disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call -disable=invalid-name,line-too-long,bad-whitespace,multiple-imports,wrong-import-position,missing-docstring,global-statement,bare-except,too-many-branches,arguments-differ,too-many-statements,too-many-nested-blocks,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-lines,consider-using-enumerate +disable=invalid-name,line-too-long,bad-whitespace,multiple-imports,wrong-import-position,missing-docstring,global-statement,bare-except,too-many-branches,arguments-differ,too-many-statements,too-many-nested-blocks,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-lines # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option From b749ce2058517cae6f69fa9632b9722c05262bae Mon Sep 17 00:00:00 2001 From: J-Donald Tournier Date: Wed, 20 Dec 2017 10:42:41 +0000 Subject: [PATCH 284/538] sh2peaks: add -fast option to allow use of SH precomputer This also allows explicit testing of the accuracy of the SH precomputer, as discussed in #1206 --- cmd/sh2peaks.cpp | 32 +++++++++++++++++++------------- testing/tests/sh2peaks | 1 + 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/cmd/sh2peaks.cpp b/cmd/sh2peaks.cpp index ed9cb614f4..66046fdf5d 100644 --- a/cmd/sh2peaks.cpp +++ b/cmd/sh2peaks.cpp @@ -69,7 +69,10 @@ void usage () + Option ("mask", "only perform computation within the specified binary brain mask image.") - + Argument ("image").type_image_in(); + + Argument ("image").type_image_in() + + + Option ("fast", + "use lookup table to compute Associated Legendre Polynomials (faster, but approximate)."); } @@ -79,7 +82,7 @@ using value_type = float; class Direction { MEMALIGN(Direction) public: - Direction () : a (NAN) { } + Direction () : a (NaN) { } Direction (const Direction& d) : a (d.a), v (d.v) { } Direction (value_type phi, value_type theta) : a (1.0), v (std::cos (phi) *std::sin (theta), std::sin (phi) *std::sin (theta), std::cos (theta)) { } value_type a; @@ -120,7 +123,7 @@ class DataLoader { MEMALIGN(DataLoader) assign_pos_of(sh).to(*mask); if (!mask->value()) { for (auto l = Loop(3) (sh); l; ++l) - item.data[sh.index(3)] = NAN; + item.data[sh.index(3)] = NaN; } } else { // iterates over SH coefficients @@ -152,7 +155,8 @@ class Processor { MEMALIGN(Processor) int npeaks, vector true_peaks, value_type threshold, - Image* ipeaks_data) : + Image* ipeaks_data, + bool use_precomputer) : dirs_vox (dirs_data), dirs (directions), lmax (lmax), @@ -160,7 +164,8 @@ class Processor { MEMALIGN(Processor) true_peaks (true_peaks), threshold (threshold), peaks_out (npeaks), - ipeaks_vox (ipeaks_data) { } + ipeaks_vox (ipeaks_data), + precomputer (use_precomputer ? new Math::SH::PrecomputedAL (lmax) : nullptr) { } bool operator() (const Item& item) { @@ -170,7 +175,7 @@ class Processor { MEMALIGN(Processor) if (check_input (item)) { for (auto l = Loop(3) (dirs_vox); l; ++l) - dirs_vox.value() = NAN; + dirs_vox.value() = NaN; return true; } @@ -178,16 +183,16 @@ class Processor { MEMALIGN(Processor) for (size_t i = 0; i < size_t(dirs.rows()); i++) { Direction p (dirs (i,0), dirs (i,1)); - p.a = Math::SH::get_peak (item.data, lmax, p.v); + p.a = Math::SH::get_peak (item.data, lmax, p.v, precomputer); if (std::isfinite (p.a)) { for (size_t j = 0; j < all_peaks.size(); j++) { if (std::abs (p.v.dot (all_peaks[j].v)) > DOT_THRESHOLD) { - p.a = NAN; + p.a = NaN; break; } } } - if (std::isfinite (p.a) && p.a >= threshold) + if (std::isfinite (p.a) && p.a >= threshold) all_peaks.push_back (p); } @@ -239,7 +244,7 @@ class Processor { MEMALIGN(Processor) dirs_vox.value() = peaks_out[n].a*peaks_out[n].v[2]; dirs_vox.index(3)++; } - for (; dirs_vox.index(3) < 3*npeaks; dirs_vox.index(3)++) dirs_vox.value() = NAN; + for (; dirs_vox.index(3) < 3*npeaks; dirs_vox.index(3)++) dirs_vox.value() = NaN; return true; } @@ -252,6 +257,7 @@ class Processor { MEMALIGN(Processor) value_type threshold; vector peaks_out; copy_ptr > ipeaks_vox; + Math::SH::PrecomputedAL* precomputer; bool check_input (const Item& item) { if (ipeaks_vox) { @@ -268,7 +274,7 @@ class Processor { MEMALIGN(Processor) if (std::isnan (item.data[i])) return true; if (no_peaks) - if (i && item.data[i] != 0.0) + if (i && item.data[i] != 0.0) no_peaks = false; } @@ -310,7 +316,7 @@ void run () Direction p (Math::pi*to (opt[n][0]) /180.0, Math::pi*float (opt[n][1]) /180.0); true_peaks.push_back (p); } - if (true_peaks.size()) + if (true_peaks.size()) npeaks = true_peaks.size(); value_type threshold = get_option_value("threshold", -INFINITY); @@ -334,7 +340,7 @@ void run () DataLoader loader (SH_data, mask_data.get()); Processor processor (peaks, dirs, Math::SH::LforN (SH_data.size (3)), - npeaks, true_peaks, threshold, ipeaks_data.get()); + npeaks, true_peaks, threshold, ipeaks_data.get(), get_options("fast").size()); Thread::run_queue (loader, Thread::batch (Item()), Thread::multi (processor)); } diff --git a/testing/tests/sh2peaks b/testing/tests/sh2peaks index 46cc7387e2..b1e5bc6eb6 100644 --- a/testing/tests/sh2peaks +++ b/testing/tests/sh2peaks @@ -1 +1,2 @@ sh2peaks sh2peaks/fod.mif - | testing_diff_peaks - sh2peaks/out.mif 1e-6 +sh2peaks sh2peaks/fod.mif -fast - | testing_diff_peaks - sh2peaks/out.mif 1e-3 From 8290896a9c4c08dd13535e7db6fb052e989507cc Mon Sep 17 00:00:00 2001 From: Thijs Dhollander Date: Thu, 21 Dec 2017 15:51:11 +1100 Subject: [PATCH 285/538] sh2peaks doc update --- docs/reference/commands/sh2peaks.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/reference/commands/sh2peaks.rst b/docs/reference/commands/sh2peaks.rst index 23e9fff95a..64fea0b9e9 100644 --- a/docs/reference/commands/sh2peaks.rst +++ b/docs/reference/commands/sh2peaks.rst @@ -33,6 +33,8 @@ Options - **-mask image** only perform computation within the specified binary brain mask image. +- **-fast** use lookup table to compute Associated Legendre Polynomials (faster, but approximate). + Standard options ^^^^^^^^^^^^^^^^ From c5cb761bf70617172bdc920fba10847b65a46b14 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 22 Dec 2017 17:25:59 +1100 Subject: [PATCH 286/538] App: New argument types for input/output directories This is particuarly useful for the fixel directory format. --- cmd/fixelcfestats.cpp | 2 +- cmd/fixelcorrespondence.cpp | 4 +- cmd/fixelcrop.cpp | 4 +- cmd/fixelreorient.cpp | 8 +- cmd/fod2fixel.cpp | 2 +- cmd/tck2fixel.cpp | 4 +- cmd/voxel2fixel.cpp | 6 +- core/app.cpp | 85 +++++++++++++++---- core/cmdline_option.h | 30 +++++-- .../commands/fixelcorrespondence.rst | 2 +- docs/reference/commands/fixelreorient.rst | 4 +- docs/reference/commands/tck2fixel.rst | 2 +- docs/reference/commands/voxel2fixel.rst | 2 +- 13 files changed, 111 insertions(+), 44 deletions(-) diff --git a/cmd/fixelcfestats.cpp b/cmd/fixelcfestats.cpp index b91801bf47..21a3c496a8 100644 --- a/cmd/fixelcfestats.cpp +++ b/cmd/fixelcfestats.cpp @@ -74,7 +74,7 @@ void usage () "NeuroImage, 2011, 54(3), 2006-19\n" ; ARGUMENTS - + Argument ("in_fixel_directory", "the fixel directory containing the data files for each subject (after obtaining fixel correspondence").type_file_in () + + Argument ("in_fixel_directory", "the fixel directory containing the data files for each subject (after obtaining fixel correspondence").type_directory_in() + Argument ("subjects", "a text file listing the subject identifiers (one per line). This should correspond with the filenames " "in the fixel directory (including the file extension), and be listed in the same order as the rows of the design matrix.").type_image_in () diff --git a/cmd/fixelcorrespondence.cpp b/cmd/fixelcorrespondence.cpp index 9edc4c9ad5..4f57cbc67c 100644 --- a/cmd/fixelcorrespondence.cpp +++ b/cmd/fixelcorrespondence.cpp @@ -37,8 +37,8 @@ void usage () ARGUMENTS + Argument ("subject_data", "the input subject fixel data file. This should be a file inside the fixel directory").type_image_in () - + Argument ("template_directory", "the input template fixel directory.").type_image_in () - + Argument ("output_directory", "the output fixel directory.").type_text() + + Argument ("template_directory", "the input template fixel directory.").type_directory_in() + + Argument ("output_directory", "the fixel directory where the output file will be written.").type_text() + Argument ("output_data", "the name of the output fixel data file. This will be placed in the output fixel directory").type_image_out (); OPTIONS diff --git a/cmd/fixelcrop.cpp b/cmd/fixelcrop.cpp index 92a524fd26..d129e42bfb 100644 --- a/cmd/fixelcrop.cpp +++ b/cmd/fixelcrop.cpp @@ -37,10 +37,10 @@ void usage () ARGUMENTS + Argument ("input_fixel_directory", "input fixel directory, all data files and directions " - "file will be cropped and saved in the output fixel directory").type_text () + "file will be cropped and saved in the output fixel directory").type_directory_in() + Argument ("input_fixel_mask", "the input fixel data file defining which fixels to crop. " "Fixels with zero values will be removed").type_image_in () - + Argument ("output_fixel_directory", "the output directory to store the cropped directions and data files").type_text (); + + Argument ("output_fixel_directory", "the output directory to store the cropped directions and data files").type_directory_out(); } diff --git a/cmd/fixelreorient.cpp b/cmd/fixelreorient.cpp index 38bd65124a..0e93b25543 100644 --- a/cmd/fixelreorient.cpp +++ b/cmd/fixelreorient.cpp @@ -38,13 +38,13 @@ void usage () "then re-normalising the vector."; ARGUMENTS - + Argument ("fixel_in", "the fixel directory").type_text () + + Argument ("fixel_in", "the input fixel directory").type_directory_in() + Argument ("warp", "a 4D deformation field used to perform reorientation. " "Reorientation is performed by applying the Jacobian affine transform in each voxel in the warp, " "then re-normalising the vector representing the fixel direction").type_image_in () - + Argument ("fixel_out", "the output fixel directory. If the the input and output directorys are the same, the existing directions file will " - "be replaced (providing the --force option is supplied). If a new directory is supplied then the fixel directions and all " - "other fixel data will be copied to the new directory.").type_text (); + + Argument ("fixel_out", "the output fixel directory. If the the input and output directories are the same, the existing directions file will " + "be replaced (providing the -force option is supplied). If a new directory is supplied then the fixel directions and all " + "other fixel data will be copied to the new directory.").type_text(); } diff --git a/cmd/fod2fixel.cpp b/cmd/fod2fixel.cpp index f68a2fc8bb..c54362265b 100644 --- a/cmd/fod2fixel.cpp +++ b/cmd/fod2fixel.cpp @@ -77,7 +77,7 @@ void usage () ARGUMENTS + Argument ("fod", "the input fod image.").type_image_in () - + Argument ("fixel_directory", "the output fixel directory").type_text(); + + Argument ("fixel_directory", "the output fixel directory").type_directory_out(); OPTIONS diff --git a/cmd/tck2fixel.cpp b/cmd/tck2fixel.cpp index 7d7ce1a2bc..105c401c64 100644 --- a/cmd/tck2fixel.cpp +++ b/cmd/tck2fixel.cpp @@ -96,8 +96,8 @@ void usage () ARGUMENTS + Argument ("tracks", "the input tracks.").type_tracks_in() - + Argument ("fixel_folder_in", "the input fixel folder. Used to define the fixels and their directions").type_text() - + Argument ("fixel_folder_out", "the output fixel folder. This can be the same as the input folder if desired").type_text() + + Argument ("fixel_folder_in", "the input fixel folder. Used to define the fixels and their directions").type_directory_in() + + Argument ("fixel_folder_out", "the fixel folder to which the output will be written. This can be the same as the input folder if desired").type_text() + Argument ("fixel_data_out", "the name of the fixel data image.").type_image_out(); OPTIONS diff --git a/cmd/voxel2fixel.cpp b/cmd/voxel2fixel.cpp index 60697977b8..82d6127c78 100644 --- a/cmd/voxel2fixel.cpp +++ b/cmd/voxel2fixel.cpp @@ -36,9 +36,9 @@ void usage () + "This command is designed to enable CFE-based statistical analysis to be performed on voxel-wise measures."; ARGUMENTS - + Argument ("image_in", "the input image.").type_image_in() - + Argument ("fixel_directory_in", "the input fixel directory. Used to define the fixels and their directions").type_text() - + Argument ("fixel_directory_out", "the output fixel directory. This can be the same as the input directory if desired").type_text() + + Argument ("image_in", "the input image.").type_image_in() + + Argument ("fixel_directory_in", "the input fixel directory. Used to define the fixels and their directions").type_directory_in() + + Argument ("fixel_directory_out", "the fixel directory where the output will be written. This can be the same as the input directory if desired").type_text() + Argument ("fixel_data_out", "the name of the fixel data image.").type_image_out(); } diff --git a/core/app.cpp b/core/app.cpp index 8ccd2df111..867395ff82 100644 --- a/core/app.cpp +++ b/core/app.cpp @@ -183,6 +183,10 @@ namespace MR return ("file in"); case ArgFileOut: return ("file out"); + case ArgDirectoryIn: + return ("directory in"); + case ArgDirectoryOut: + return ("directory out"); case ImageIn: return ("image in"); case ImageOut: @@ -430,6 +434,12 @@ namespace MR case ArgFileOut: stream << "FILEOUT"; break; + case ArgDirectoryIn: + stream << "DIRIN"; + break; + case ArgDirectoryOut: + stream << "DIROUT"; + break; case Choice: stream << "CHOICE"; for (const char* const* p = limits.choices; *p; ++p) @@ -1042,27 +1052,68 @@ namespace MR // if necessary, also check for pre-existence of any output files with known paths // (if the output is e.g. given as a prefix, the argument should be flagged as type_text()) for (const auto& i : argument) { - if ((i.arg->type == ArgFileIn || i.arg->type == TracksIn) && !Path::exists (std::string(i))) - throw Exception ("required input file \"" + str(i) + "\" not found"); - if (i.arg->type == ArgFileOut || i.arg->type == TracksOut) - check_overwrite (std::string(i)); - if (i.arg->type == TracksIn && !Path::has_suffix (str(i), ".tck")) - throw Exception ("input file " + str(i) + " is not a valid track file"); - if (i.arg->type == TracksOut && !Path::has_suffix (str(i), ".tck")) - throw Exception ("output track file (" + str(i) + ") must use the .tck suffix"); + const std::string text = std::string (i); + if (i.arg->type == ArgFileIn || i.arg->type == TracksIn) { + if (!Path::exists (text)) + throw Exception ("required input file \"" + text + "\" not found"); + if (!Path::is_file (text)) + throw Exception ("required input \"" + text + "\" is not a file"); + } + if (i.arg->type == ArgDirectoryIn) { + if (!Path::exists (text)) + throw Exception ("required input directory \"" + text + "\" not found"); + if (!Path::is_dir (text)) + throw Exception ("required input \"" + text + "\" is not a directory"); + } + if (i.arg->type == ArgFileOut || i.arg->type == TracksOut) { + if (text.find_last_of (PATH_SEPARATOR) == text.size() - std::string(PATH_SEPARATOR).size()) + throw Exception ("output path \"" + std::string(i) + "\" is not a valid file path (ends with \'" PATH_SEPARATOR "\")"); + check_overwrite (text); + } + if (i.arg->type == ArgDirectoryOut) + check_overwrite (text); + if (i.arg->type == TracksIn && !Path::has_suffix (text, ".tck")) + throw Exception ("input file \"" + text + "\" is not a valid track file"); + if (i.arg->type == TracksOut && !Path::has_suffix (text, ".tck")) + throw Exception ("output track file \"" + text + "\" must use the .tck suffix"); + if (i.arg->type == ArgDirectoryOut) { + const std::string base_name = Path::basename (text); + if (base_name.find (".") != std::string::npos) + throw Exception ("output path \"" + text + "\" is not a valid directory path (contains a \'.\')"); + } } for (const auto& i : option) { for (size_t j = 0; j != i.opt->size(); ++j) { const Argument& arg = i.opt->operator [](j); - const char* const name = i.args[j]; - if ((arg.type == ArgFileIn || arg.type == TracksIn) && !Path::exists (name)) - throw Exception ("input file \"" + str(name) + "\" not found (required for option \"-" + std::string(i.opt->id) + "\")"); - if (arg.type == ArgFileOut || arg.type == TracksOut) - check_overwrite (name); - if (arg.type == TracksIn && !Path::has_suffix (str(name), ".tck")) - throw Exception ("input file " + str(name) + " is not a valid track file"); - if (arg.type == TracksOut && !Path::has_suffix (str(name), ".tck")) - throw Exception ("output track file (" + str(name) + ") must use the .tck suffix"); + const std::string text = std::string (i.args[j]); + if (arg.type == ArgFileIn || arg.type == TracksIn) { + if (!Path::exists (text)) + throw Exception ("input file \"" + text + "\" for option \"-" + std::string(i.opt->id) + "\" not found"); + if (!Path::is_file (text)) + throw Exception ("input \"" + text + "\" for option \"-" + std::string(i.opt->id) + "\" is not a file"); + } + if (arg.type == ArgDirectoryIn) { + if (!Path::exists (text)) + throw Exception ("input directory \"" + text + "\" for option \"-" + std::string(i.opt->id) + "\" not found"); + if (!Path::is_dir (text)) + throw Exception ("input \"" + text + "\" for option \"-" + std::string(i.opt->id) + "\" is not a directory"); + } + if (arg.type == ArgFileOut || arg.type == TracksOut) { + if (text.find_last_of (PATH_SEPARATOR) == text.size() - std::string (PATH_SEPARATOR).size()) + throw Exception ("output path \"" + text + "\" for option \"-" + std::string(i.opt->id) + "\" is not a valid file path (ends with \'" PATH_SEPARATOR "\")"); + check_overwrite (text); + } + if (arg.type == ArgDirectoryOut) + check_overwrite (text); + if (arg.type == TracksIn && !Path::has_suffix (text, ".tck")) + throw Exception ("input file \"" + text + "\" for option \"-" + std::string(i.opt->id) + "\" is not a valid track file"); + if (arg.type == TracksOut && !Path::has_suffix (text, ".tck")) + throw Exception ("output track file \"" + text + "\" for option \"-" + std::string(i.opt->id) + "\" must use the .tck suffix"); + if (arg.type == ArgDirectoryOut) { + const std::string base_name = Path::basename (text); + if (base_name.find (".") != std::string::npos) + throw Exception ("output path \"" + text + "\" for option \"-" + std::string(i.opt->id) + "\" is not a valid directory path (contains a \'.\')"); + } } } diff --git a/core/cmdline_option.h b/core/cmdline_option.h index 4cf2b62fde..7bd0144b29 100644 --- a/core/cmdline_option.h +++ b/core/cmdline_option.h @@ -48,6 +48,8 @@ namespace MR Float, ArgFileIn, ArgFileOut, + ArgDirectoryIn, + ArgDirectoryOut, Choice, ImageIn, ImageOut, @@ -76,7 +78,7 @@ namespace MR * * The list of arguments is provided by adding to the ARGUMENTS vector, like this: * \code - * ARGUMENTS + * ARGUMENTS * + Argument ("input", "the input image") * .type_image_in() * @@ -240,6 +242,20 @@ namespace MR return *this; } + //! specifies that the argument should be an input directory + Argument& type_directory_in () { + assert (type == Undefined); + type = ArgDirectoryIn; + return *this; + } + + //! specifies that the argument should be an output directory + Argument& type_directory_out () { + assert (type == Undefined); + type = ArgDirectoryOut; + return *this; + } + //! specifies that the argument should be a sequence of comma-separated integer values Argument& type_sequence_int () { assert (type == Undefined); @@ -287,7 +303,7 @@ namespace MR * The list of options is provided using the OPTIONS macro, like this: * \code * OPTIONS - * + Option ("exact", + * + Option ("exact", * "do not use approximations when processing") * * + Option ("mask", @@ -295,11 +311,11 @@ namespace MR * "the binary image specified") * + Argument ("image").type_image_in() * - * + Option ("regularisation", + * + Option ("regularisation", * "set the regularisation term") * + Argument ("value").type_float (0.0, 1.0, 100.0) * - * Option ("dump", + * Option ("dump", * "dump all intermediate values to file") * + Argument ("file").type_file(); * \endcode @@ -389,18 +405,18 @@ namespace MR * + Option ("option2", ...); * } * \endcode - */ + */ class OptionGroup : public vector