vistalab / vistasoft

VISTASOFT is the main software repository of the VISTA lab at Stanford University.
http://vistalab.stanford.edu
148 stars 142 forks source link

mrAnatSetNiftiXform error #347

Closed hyosmos closed 3 years ago

hyosmos commented 3 years ago

I select mrAnatAverageAcPcNifti.m output data in mrAnatSetNiftiXform, and it didn't work well.

freq_dim not set correctly in NIFTI header.
phase_dim not set correctly in NIFTI header.
Error using num2str (line 47)
Input to num2str must be numeric.

Error in mrAnatSetNiftiXform (line 36)
hstr = num2str(h);

Anything wrong with it?

francopestilli commented 3 years ago

this is an issue related to the update in how figure handles are returned in matlab. h used to be a single number identifying the figure ID. In the most recent versions of matlab h is instead a struct.

The code compatible with matlab after 2017:

hstr = num2str(h.Number)

@wandell @JWinawer

hyosmos commented 3 years ago

this is an issue related to the update in how figure handles are returned in matlab. h used to be a single number identifying the figure ID. In the most recent versions of matlab h is instead a struct.

The code compatible with matlab after 2017:

hstr = num2str(h.Number)

@wandell @JWinawer

Thank you! It works.