Browse files

ENH: mvpa2-analysis -- record processing time and store hdf5 prior tr…

…ying to save nifti
  • Loading branch information...
1 parent 76a9d26 commit 153f0029d5f20d63c65c7d98ea1cc4da3343915a @yarikoptic yarikoptic committed May 16, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 bin/mvpa2-analysis
View
9 bin/mvpa2-analysis
@@ -390,19 +390,24 @@ def run_analysis(files, options):
verbose(1, "Estimating the measure on loaded data")
verbose(2, "Measure: %r" % measure)
+ t0 = time.time()
results = measure(data)
+ results.a['proccessing_time'] = time.time() - t0
if not ofile is None:
verbose(1, "Storing results using prefix %r" % ofile)
print np.histogram(results.samples)
+
+ # We could "always" save to HDF5, which also would assure
+ # that we have output directory
+ mv.h5save(ofile + 'results.hdf5', results, mkdir=True)
+
# TODO: some might not be mapped to Nifti that easily
# map the result vector back into a nifti image
rimg = mv.map2nifti(data, results)
# save to file
rimg.to_filename(ofile + 'results.nii.gz')
- # but we could "always" save to HDF5
- mv.h5save(ofile + 'results.hdf5', results)
else:
verbose(1, "Results:\n%r" % results)

0 comments on commit 153f002

Please sign in to comment.