Skip to content

Commit

Permalink
Merge branch 'master' into tiff_image_format
Browse files Browse the repository at this point in the history
  • Loading branch information
Lestropie authored Jun 28, 2017
2 parents 389cfd9 + bbc5ec1 commit 0167bde
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 24 deletions.
2 changes: 1 addition & 1 deletion cmd/fixelcrop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void run ()
Fixel::check_fixel_directory (out_fixel_directory, true);

Header out_header = Header (in_index_image);
size_t total_nfixels = std::stoul (out_header.keyval ()[Fixel::n_fixels_key]);
size_t total_nfixels = Fixel::get_number_of_fixels (in_index_header);

// We need to do a first pass of the mask image to determine the number of cropped fixels
for (auto l = Loop (0) (mask_image); l; ++l) {
Expand Down
12 changes: 6 additions & 6 deletions cmd/mrconvert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ DESCRIPTION

+ OptionGroup ("Options to modify generic header entries")

+ Option ("clear_property",
+ Option ("clear_property",
"remove the specified key from the image header altogether.").allow_multiple()
+ Argument ("key").type_text()

+ Option ("set_property",
+ Option ("set_property",
"set the value of the specified key in the image header.").allow_multiple()
+ Argument ("key").type_text()
+ Argument ("value").type_text()

+ Option ("append_property",
+ Option ("append_property",
"append the given value to the specified key in the image header (this adds the value specified as a new line in the header value).").allow_multiple()
+ Argument ("key").type_text()
+ Argument ("value").type_text()
Expand Down Expand Up @@ -288,11 +288,11 @@ void run ()
}

opt = get_options ("set_property");
for (size_t n = 0; n < opt.size(); ++n)
for (size_t n = 0; n < opt.size(); ++n)
header_out.keyval()[opt[n][0].as_text()] = opt[n][1].as_text();

opt = get_options ("append_property");
for (size_t n = 0; n < opt.size(); ++n)
for (size_t n = 0; n < opt.size(); ++n)
add_line (header_out.keyval()[opt[n][0].as_text()], opt[n][1].as_text());


Expand Down Expand Up @@ -342,7 +342,7 @@ void run ()
}
} catch (...) {
WARN ("Phase encoding scheme of input file does not match number of image volumes; omitting information from output image");
PhaseEncoding::set_scheme (header_out, pe_scheme);
PhaseEncoding::set_scheme (header_out, Eigen::MatrixXd());
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/tckconvert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ void usage ()
{
AUTHOR = "Daan Christiaens ([email protected]), "
"J-Donald Tournier ([email protected]), "
"Philip Broser ([email protected]).";
"Philip Broser ([email protected]), "
"Daniel Blezek ([email protected]).";

SYNOPSIS = "Convert between different track file formats";

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/commands/tckconvert.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Standard options



**Author:** Daan Christiaens ([email protected]), J-Donald Tournier ([email protected]), Philip Broser ([email protected]).
**Author:** Daan Christiaens ([email protected]), J-Donald Tournier ([email protected]), Philip Broser ([email protected]), Daniel Blezek ([email protected]).

**Copyright:** Copyright (c) 2008-2017 the MRtrix3 contributors.

Expand Down
33 changes: 18 additions & 15 deletions lib/mrtrix3/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,21 +284,24 @@ def debug(text):
global colourClear, colourDebug
global _verbosity
if _verbosity <= 2: return
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
# If debug() has been called from within some external function (e.g. a library function), it's often to report on the outcome of that function.
# In this instance, find the location where that function itself was called from, rather than where debug() was called from.
caller = inspect.getframeinfo(inspect.stack()[min(2,len(inspect.stack()))][0])
sys.stderr.write(os.path.basename(sys.argv[0]) + ': ' + colourDebug + '[DEBUG] ' + funcname + ' (from ' + os.path.basename(caller.filename) + ':' + str(caller.lineno) + '): ' + text + colourClear + '\n')
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')

def error(text):
import os, sys
Expand Down

0 comments on commit 0167bde

Please sign in to comment.