Skip to content

Commit

Permalink
tckstats: -dump option supports .npy format
Browse files Browse the repository at this point in the history
  • Loading branch information
Lestropie committed Mar 1, 2022
1 parent 0e20a35 commit 771d50b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions cmd/tckstats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,8 @@ void run ()
WARN ("Do not have streamline step size with which to bin histogram; histogram will be generated using 1mm bin widths");
}

std::unique_ptr<File::OFStream> dump;
auto opt = get_options ("dump");
if (opt.size())
dump.reset (new File::OFStream (std::string(opt[0][0]), std::ios_base::out | std::ios_base::trunc));
vector<float> dump;
dump.reserve (header_count);

ProgressBar progress ("Reading track file", header_count);
Streamline<> tck;
Expand All @@ -151,10 +149,13 @@ void run ()
} else {
++empty_streamlines;
}
if (dump)
(*dump) << length << "\n";
dump.push_back (length);
++progress;
}

auto opt = get_options ("dump");
if (opt.size())
File::Matrix::save_vector (dump, opt[0][0]);
}

if (!get_options ("ignorezero").size() && (empty_streamlines || zero_length_streamlines)) {
Expand Down
2 changes: 1 addition & 1 deletion core/math/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ namespace MR
template <class Cont>
class is_eigen_type { NOMEMALIGN
typedef char yes[1], no[2];
template<typename C> static yes& test(typename Cont::Scalar);
template<typename C> static yes& test(typename C::Scalar);
template<typename C> static no& test(...);
public:
static const bool value = sizeof(test<Cont>(0)) == sizeof(yes);
Expand Down

0 comments on commit 771d50b

Please sign in to comment.