axTwo.legend(loc='upper right') #Add plots to figure fig.add_subplot(axOne) fig.add_subplot(axTwo) #Save plot plt.suptitle(args.out[0]) fig.set_size_inches(15, 5) fig.savefig('%s_wbPlot.jpeg' % (args.out[0]), bbox_inches='tight') except (RuntimeError, IOError): print 'ERROR: Could not save figure. Moving on...' #Don't do region/voxel estimation if user says not to if args.noRoi == 1: nagini.writeArgs(args, args.out[0]) sys.exit() #Get number of parameters for roi/voxel optimization nParam = wbOpt.shape[0] - 1 roiInit = np.copy(wbOpt[0:nParam]) #Set default region bounds lBounds = [] hBounds = [] bScale = [3, 3] for pIdx in range(nParam): if wbOpt[pIdx] > 0: lBounds.append(wbOpt[pIdx] / bScale[pIdx]) hBounds.append(wbOpt[pIdx] * bScale[pIdx]) elif wbOpt[pIdx] < 0:
#Make sure we have legend for input function plot axTwo.legend(loc='upper right') #Add plots to figure fig.add_subplot(axOne); fig.add_subplot(axTwo) #Save plot plt.suptitle(args.out[0]) fig.set_size_inches(15,5) fig.savefig('%s_wbPlot.jpeg'%(args.out[0]),bbox_inches='tight') except(RuntimeError,IOError): print 'ERROR: Could not save figure. Moving on...' #Don't do voxelwise estimation if user says not to if args.wbOnly == 1: nagini.writeArgs(args,args.out[0]) sys.exit() #Get number of parameters for voxelwise optimizations if args.fModel == 1 or args.noDelay == 1: nParam = wbOpt.shape[0] else: nParam = wbOpt.shape[0]-1 voxInit = np.copy(wbOpt[0:nParam]) #Set default voxelwise bounds lBounds = []; hBounds = []; bScale = [2.5,3] for pIdx in range(nParam): if wbOpt[pIdx] > 0: lBounds.append(np.max([wbOpt[pIdx]/bScale[pIdx],wbBounds[0][pIdx]])) hBounds.append(np.min([wbOpt[pIdx]*bScale[pIdx],wbBounds[1][pIdx]]))