def _write_mri_config(fname, subject_from, subject_to, scale):
 scale = np.asarray(scale)
 if (np.isscalar(scale) or (scale.shape == ())):
  n_params = 1
 else:
  n_params = 3
 config = configparser.RawConfigParser()
 config.add_section('MRI Scaling')
 config.set('MRI Scaling', 'subject_from', subject_from)
 config.set('MRI Scaling', 'subject_to', subject_to)
 config.set('MRI Scaling', 'n_params', str(n_params))
 if (n_params == 1):
  config.set('MRI Scaling', 'scale', str(scale))
 else:
  config.set('MRI Scaling', 'scale', ' '.join([str(s) for s in scale]))
 config.set('MRI Scaling', 'version', '1')
 with open(fname, 'w') as fid:
  config.write(fid)

def _write_mri_config ( fname , subject_from , subject_to , scale ) : scale = np . asarray ( scale ) if ( np . isscalar ( scale ) or ( scale . shape == ( ) ) ) : n_params = 1 else : n_params = 3 config = configparser . RawConfigParser ( ) config . add_section ( 'MRI Scaling' ) config . set ( 'MRI Scaling' , 'subject_from' , subject_from ) config . set ( 'MRI Scaling' , 'subject_to' , subject_to ) config . set ( 'MRI Scaling' , 'n_params' , str ( n_params ) ) if ( n_params == 1 ) : config . set ( 'MRI Scaling' , 'scale' , str ( scale ) ) else : config . set ( 'MRI Scaling' , 'scale' , ' ' . join ( [ str ( s ) for s in scale ] ) ) config . set ( 'MRI Scaling' , 'version' , '1' ) with open ( fname , 'w' ) as fid : config . write ( fid )
write the cfg file describing a scaled mri subject .